requrl
TypeScript icon, indicating that this package has built-in type declarations

3.0.2 • Public • Published

requrl

npm dt bundlephobia

Grab full URL from request.

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

import getURL from 'requrl'
// OR
const getURL = require('requrl')

Function signuture is:

function getURL(req?: IncomingMessage, includePath?: boolean): string

Example:

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

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 3.0.2
    79,654
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 3.0.2
    79,654
  • 3.0.1
    2
  • 3.0.0
    0
  • 2.0.1
    824
  • 2.0.0
    0

Package Sidebar

Install

npm i requrl

Weekly Downloads

64,922

Version

3.0.2

License

MIT

Unpacked Size

5.63 kB

Total Files

6

Last publish

Collaborators

  • pi0