1.1.2 • Published 4 years ago

urlful v1.1.2

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

urlful

npm dt bundlephobia

Easily grab full URL from a request (http.IncomingMessage) object.

Features

  • Universal (browser and node.js) support
  • Detect HTTPS requests using is-https
  • Support x-forwarded-proto and x-forwarded-host
  • Always encode URI
  • Super Small

Usage

ESM import:

import getURL from 'urlful'

CommonJS import:

const getURL = require('urlful')

Default export signuture is:

getURL (request?: http.IncomingMessage) : string

Example:

const url = getURL(req)
// http://localhost:3000/aaf/dfdf
// https://www.foo.com/foo/bar

License

MIT

1.1.1

4 years ago

1.1.0

4 years ago

1.1.2

4 years ago

1.0.0

4 years ago