prepend-http-extra
v1.0.0
Published
Same as `prepend-http` but handles the case when starts with `//`, like CDNs.
Downloads
18
Readme
prepend-http-extra
Same as
prepend-http
but handles the case when starts with//
, like CDNs.
Install
npm i prepend-http-extra --save
Usage
For more use-cases see the tests
const prepend = require('prepend-http-extra')
prepend('https://foo.com') // => 'https://foo.com'
prepend('http://bar.com') // => 'http://bar.com'
prepend('baz.com') // => 'http://baz.com'
prepend('//qux.com') // => 'http://qux.com'
prepend('/abs.com') // => '/abs.com'
prepend('./rel.com') // => './rel.com'
prepend('../par.com') // => '../par.com'
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
But before doing anything, please read the CONTRIBUTING.md guidelines.