Fetch http(s) headers and statusCode or error.
npm install fast-head
npm install --save fast-head
or, with yarn
yarn add fast-head
`Usage
`js
const fastHead = require('fast-head');fastHead('http://www.yamaska.ca/')
.then(({ elapsed, headers, statusCode, error }) => {
// either headers and status code are filled,
// or it's error
})
.catch(console.error)
`API
$3
#### url
Type: string* http://www.yamaska.ca/
* https://www.yamaska.ca/
* Etc.
#### timeout (optionnal)
Type:
number in ms
Default: 5000See fastHead.defaultTimeout.
$3
Type: number in msTo obtain the value of the default timeout. Since there's a single
fastHead`, it's best not to change this field. Want to contribute and [make it read-only?][4]* [add http2 support][1]
* [add url.parse() support][2]
* [add new URL() support][3]
* [make fastHead.defaultTimeout read-only][4]
[1]: https://github.com/millette/fast-head/issues/1
[2]: https://github.com/millette/fast-head/issues/2
[3]: https://github.com/millette/fast-head/issues/3
[4]: https://github.com/millette/fast-head/issues/4