2023-12-18 13:12:25 +08:00
|
|
|
# prepend-http [](https://travis-ci.org/sindresorhus/prepend-http)
|
|
|
|
|
|
|
|
> Prepend `http://` to humanized URLs like `todomvc.com` and `localhost`
|
|
|
|
|
|
|
|
|
|
|
|
## Install
|
|
|
|
|
|
|
|
```
|
2024-01-16 21:26:16 +08:00
|
|
|
$ npm install --save prepend-http
|
2023-12-18 13:12:25 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
```js
|
|
|
|
const prependHttp = require('prepend-http');
|
|
|
|
|
|
|
|
prependHttp('todomvc.com');
|
|
|
|
//=> 'http://todomvc.com'
|
|
|
|
|
|
|
|
prependHttp('localhost');
|
|
|
|
//=> 'http://localhost'
|
|
|
|
|
|
|
|
prependHttp('http://todomvc.com');
|
|
|
|
//=> 'http://todomvc.com'
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## License
|
|
|
|
|
|
|
|
MIT © [Sindre Sorhus](https://sindresorhus.com)
|