prepend-http

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

MIT License

Downloads
39M
Stars
62
Committers
7

prepend-http

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

Install

$ npm install prepend-http

Usage

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://.


Package Rankings
Top 24.44% on Repo1.maven.org
Top 1.93% on Npmjs.org
Top 16.67% on Bower.io