1.7.0 • Published 5 years ago

second-fetcher v1.7.0

Weekly downloads
13
License
MIT
Repository
github
Last release
5 years ago

Second Fetcher

Installation

npm install --save second-fetcher

API

new Fetcher({ ?handlers, ?request, ?disableFetchHandler }) -> Fetcher

Constructs a new fetcher.

Arguments

  • handlers (Array): An array of handler functions. When given a request where uri is not a string, fetcher will iterate over the handlers, calling them in turn until one returns a string.
  • request (Function): A function that takes a single parameter, url, and returns a Promise that resolves to an object with body and statusCode properties.
  • disableFetchHandler (Boolean): By default the fetcher will inspect fetch results to check HTTP status code and handle any errors. This can be disabled, for example to implement custom result handling.

request(requests) -> Object

Makes a request for each RequestObject in requests. Returns an object of type { [string]: Promise }, where the keys When there are no more outstanding requests, the return value

Arguments

  • requests ({ string: RequestObject }): An object where each key is a request identifier, and the values are RequestObjects.
1.7.0

5 years ago

1.6.0

6 years ago

1.5.2

6 years ago

1.5.1

7 years ago

1.5.0

7 years ago

1.2.3

7 years ago

1.2.0

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.0

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago