Skip to content

tunnckoCore/prepend-http-extra

Repository files navigation

Same as prepend-http but handles the case when starts with //, like CDNs.

code climate standard code style travis build status coverage status dependency status

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.

tunnckocore.tk keybase tunnckocore tunnckoCore npm tunnckoCore twitter tunnckoCore github