• Home
  • Raw
  • Download

Lines Matching full:fetch

1fetch [![npm version](https://img.shields.io/npm/v/npm-registry-fetch.svg)](https://npm.im/npm-reg…
3 [`npm-registry-fetch`](https://github.com/npm/npm-registry-fetch) is a Node.js
4 library that implements a `fetch`-like API for accessing npm registry APIs
15 const npmFetch = require('npm-registry-fetch')
28 * [`fetch`](#fetch)
29 * [`fetch.json`](#fetch-json)
30 * [`fetch` options](#fetch-opts)
34 `$ npm install npm-registry-fetch`
67 request that comes through `npm-registry-fetch` that contains `write=true`
72 #### <a name="fetch"></a> `> fetch(url, [opts]) -> Promise<Response>`
79 For available options, please see the section on [`fetch` options](#fetch-opts).
84 const res = await fetch('/-/ping')
89 #### <a name="fetch-json"></a> `> fetch.json(url, [opts]) -> Promise<ResponseJSON>`
93 `fetch(url).then(res => res.json())`.
95 For available options, please see the section on [`fetch` options](#fetch-opts).
100 const res = await fetch.json('/-/ping')
104 #### <a name="fetch-json-stream"></a> `> fetch.json.stream(url, jsonPath, [opts]) -> Stream`
114 For available options, please see the section on [`fetch` options](#fetch-opts).
120 for await (let {key, value} of fetch.json.stream('/-/user/zkat/package', '$*')) {
125 #### <a name="fetch-opts"></a> `fetch` Options
127 Fetch options are optional, and can be passed in as either a Map-like object
137 be shared across requests. This allows multiple concurrent `fetch` requests to
213 ##### <a name="opts-fetch-retries"></a> `opts.fetch-retries`
224 ##### <a name="opts-fetch-retry-factor"></a> `opts.fetch-retry-factor`
235 ##### <a name="opts-fetch-retry-mintimeout"></a> `opts.fetch-retry-mintimeout`
246 ##### <a name="opts-fetch-retry-maxtimeout"></a> `opts.fetch-retry-maxtimeout`
272 If true, `npm-registry-fetch` will set the `Content-Encoding` header to `gzip`
282 override headers automatically generated by `npm-registry-fetch`, such as
364 When using `fetch.json.stream()` (NOT `fetch.json()`), this will be passed down
407 `npm-registry-fetch` to fill in missing cache data, see
535 override individually-passed `fetch-retry-*` settings.
607 * Default: `'npm-registry-fetch@<version>/node@<node-version>+<arch> (<platform>)'`