@cjser/prepend-http
v4.0.0-cjser.2
Published
Prepend `https://` to humanized URLs like sindresorhus.com and localhost
Downloads
79
Maintainers
Readme
prepend-http
Prepend
https://to humanized URLs likesindresorhus.comandlocalhost
Install
$ npm install prepend-httpUsage
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://.
cjser
This package is a CommonJS-compatible build generated by cjser for projects that still need require() support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.
Original repository: https://github.com/sindresorhus/prepend-http
