prepend-http
Prepend `https://` to humanized URLs like sindresorhus.com and localhost
Last updated a year ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ 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 (a year ago)

8 Versions

  • 3.0.1                                ...           a year ago
  • 3.0.0                                ...           a year ago
  • 2.0.0                                ...           3 years ago
  • 1.0.4                                ...           4 years ago
  • 1.0.3                                ...           5 years ago
  • 1.0.2                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           6 years ago

Copyright 2014 - 2016 © taobao.org |