1.0.1 • Published 10 months ago

@waveorb/request v1.0.1

Weekly downloads
-
License
-
Repository
github
Last release
10 months ago

Waveorb request

NodeJS request URL parser. Modifies the request object to include:

  • Proxy host and protocol
  • If you're on https or not
  • Remote IP address
  • Parsed query string
  • Everything else that the standard url includes

Uses the new syntax in NodeJS url.

Install

npm i @waveorb/request

Usage

var request = require('request')

request(req)

# URL: http://localhost:3000/?hello=1

req.href: 'http://localhost:3000/?hello=1'
req.origin: 'http://localhost:3000'
req.protocol: 'http:'
req.username: ''
req.password: ''
req.host: 'localhost:3000'
req.hostname: 'localhost'
req.port: '3000'
req.pathname: '/'
req.search: '?hello=1'
req.searchParams: URLSearchParams { 'hello' => '1' }
req.hash: ''
req.ip: '127.0.0.1'
req.query: { hello: '1' }
req.path: '/?hello=1'

Created by Eldøy Projects

1.0.1

10 months ago

1.0.0

10 months ago