# requrl

> Grab full URL from request

Latest version **3.0.2** (published 2020-12-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install requrl
pnpm add requrl
yarn add requrl
bun add requrl
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.2 |
| Published | 2020-12-18 |
| First published | 2016-06-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 37 |
| Maintainers | pi0 |

## Links

- npm: https://www.npmjs.com/package/requrl
- Repository: https://github.com/nuxt-contrib/requrl
- Homepage: https://github.com/nuxt-contrib/requrl#readme
- Issues: https://github.com/nuxt-contrib/requrl/issues
- npm.io page: https://npm.io/package/requrl

## Recent versions

- 3.0.2 (latest) — 2020-12-18
- 3.0.1 — 2020-12-18
- 3.0.0 — 2020-12-14
- 2.0.1 — 2020-04-24
- 2.0.0 — 2020-04-21
- 1.3.21 — 2016-06-16

## README

# requrl

[![npm](https://flat.badgen.net/npm/v/requrl)](https://www.npmjs.com/package/requrl)
[![dt](https://flat.badgen.net/npm/dt/requrl)](https://www.npmjs.com/package/requrl)
[![bundlephobia](https://flat.badgen.net/bundlephobia/minzip/requrl)](https://bundlephobia.com/result?p=requrl)

Grab full URL from [request](https://nodejs.org/api/http.html#http_class_http_incomingmessage).

## Features

- Universal (browser and node.js) support
- Detect HTTPS requests using [is-https](https://github.com/nuxt-contrib/is-https)
- Support `x-forwarded-proto` and `x-forwarded-host`
- Always encode URI
- Super Small

## Usage

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

Function signuture is:

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

Example:

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

## License

MIT

---
_Source: https://npm.io/package/requrl · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
