fast-head

0.0.2 • Public • Published

fast-head

Build Status Coverage Status Dependency Status

Fetch http(s) headers and statusCode or error.

Install

npm install --save fast-head
# or, with yarn
yarn add fast-head

Usage

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

fastHead(url, [timeout])

url

Type: string

timeout (optionnal)

Type: number in ms
Default: 5000

See fastHead.defaultTimeout.

fastHead.defaultTimeout

Type: number in ms

To 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?

Contribute

Contributions are appreciated! Here are a few ideas to get you started:

License

AGPL-v3 © 2017 Robin Millette

Package Sidebar

Install

npm i fast-head

Weekly Downloads

1

Version

0.0.2

License

AGPL-3.0

Last publish

Collaborators

  • millette