https://github.com/eldoy/rekvest
NodeJS request URL parser
https://github.com/eldoy/rekvest
Last synced: 6 months ago
JSON representation
NodeJS request URL parser
- Host: GitHub
- URL: https://github.com/eldoy/rekvest
- Owner: eldoy
- License: mit
- Created: 2020-10-30T02:35:33.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-08-01T01:08:05.000Z (almost 2 years ago)
- Last Synced: 2025-10-26T19:44:39.241Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 397 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rekvest
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 rekvest
```
### Usage
```
var rekvest = require('rekvest')
rekvest(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'
```
MIT Licensed. Enjoy!
Created by [Eldøy Projects](https://eldoy.com)