# prepend-http

> Prepend `https://` to humanized URLs like sindresorhus.com and localhost

Latest version **4.0.0** (published 2021-08-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install prepend-http
pnpm add prepend-http
yarn add prepend-http
bun add prepend-http
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2021-08-09 |
| First published | 2014-11-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | ^12.20.0 \|\| ^14.13.1 \|\| >=16.0.0 |
| Dependencies | 0 |
| Unpacked size | 3.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 66 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | prepend, protocol, scheme, url, http, https, humanized |

## Links

- npm: https://www.npmjs.com/package/prepend-http
- Repository: https://github.com/sindresorhus/prepend-http
- Homepage: https://github.com/sindresorhus/prepend-http#readme
- Issues: https://github.com/sindresorhus/prepend-http/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/prepend-http

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 4.0.0 (latest) — 2021-08-09
- 3.0.1 — 2019-05-01
- 3.0.0 — 2019-05-01
- 2.0.0 — 2017-09-23
- 1.0.4 — 2016-05-10
- 1.0.3 — 2015-09-02
- 1.0.2 — 2015-07-23
- 1.0.1 — 2015-01-11
- 1.0.0 — 2014-11-16

## README

# prepend-http

> Prepend `https://` to humanized URLs like `sindresorhus.com` and `localhost`

## Install

```
$ npm install prepend-http
```

## Usage

```js
import prependHttp from 'prepend-http';

prependHttp('sindresorhus.com');
//=> 'https://sindresorhus.com'

prependHttp('localhost', {https: false});
//=> 'http://localhost'

prependHttp('https://sindresorhus.com');
//=> 'https://sindresorhus.com'
```

## API

### prependHttp(url, options?)

#### url

Type: `string`

The URL to prepend `https://` to.

#### options

Type: `object`

##### https

Type: `boolean`\
Default: `true`

Prepend `https://` instead of `http://`.

---

<div align="center">
	<b>
		<a href="https://tidelift.com/subscription/pkg/npm-prepend-http?utm_source=npm-prepend-http&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
	</b>
	<br>
	<sub>
		Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
	</sub>
</div>

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