prepend-http
Prepend `http://` to humanized URLs like todomvc.com and localhost
Last updated 8 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm
$ cnpm install prepend-http 
SYNC missed versions from official npm registry.

prepend-http Build Status

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

Install

$ npm install prepend-http

Usage

const prependHttp = require('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

URL to prepend https:// to.

options

Type: object

https

Type: boolean
Default: true

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

License

MIT © Sindre Sorhus

Current Tags

  • 3.0.1                                ...           latest (6 years ago)

3 Versions

  • 3.0.1                                ...           6 years ago
  • 1.0.4                                ...           9 years ago
  • 2.0.0                                ...           8 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (2)
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org