prepend-www

1.0.2 • Public • Published

prepend-www Travis (.org)

Prepend http://www. to URLs

Install

$ npm install prepend-www

or

$ yarn add prepend-www

Usage

const prependWWW = require('prepend-www');

prependWWW('http://demo.com');
//=> 'http://www.demo.com'

prependWWW('demo.com', {https: true});
//=> 'https://www.demo.com'

prependWWW('demo.com');
//=> 'http://www.demo.com'

prependWWW('localhost');
//=> 'http://www.localhost'

API

prependWWW(url, [options])

url

Type: string

URL to prepend http://www. on.

options

Type: Object

https

Type: boolean
Default: false

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

License

MIT © Jalal Azimi

Package Sidebar

Install

npm i prepend-www

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

2.85 kB

Total Files

4

Last publish

Collaborators

  • jalalazimi