Skip to content
This repository was archived by the owner on Aug 18, 2022. It is now read-only.

Commit 0a190a8

Browse files
committed
fix(proj): initial fork changes
BREAKING CHANGE: this renames the library altogether
1 parent be4a050 commit 0a190a8

16 files changed

+1178
-1367
lines changed

.babelrc

Lines changed: 0 additions & 52 deletions
This file was deleted.

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
language: node_js
22
node_js:
3-
- "4"
3+
- "7"
44
- "6"
5-
- "node"
5+
- "4"
66
env:
77
- FORMDATA_VERSION=1.0.0
88
- FORMDATA_VERSION=2.1.0

ERROR-HANDLING.md

Lines changed: 0 additions & 23 deletions
This file was deleted.

LIMITS.md

Lines changed: 0 additions & 30 deletions
This file was deleted.

README.md

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11

2-
node-fetch
3-
==========
2+
node-fetch-npm
3+
==============
44

55
[![npm version][npm-image]][npm-url]
66
[![build status][travis-image]][travis-url]
77
[![coverage status][codecov-image]][codecov-url]
88

99
A light-weight module that brings `window.fetch` to Node.js
1010

11+
`node-fetch-npm` is a fork of [`node-fetch`](https://npm.im/node-fetch) used in
12+
npm itself, through [`make-fetch-happen`](https://npm.im/make-fetch-happen). It
13+
has more regular releases and accepts some patches that would not fit with
14+
`node-fetch`'s own design goals (such as picking a specific cookie library).
1115

1216
## Motivation
1317

@@ -28,15 +32,15 @@ See Matt Andrews' [isomorphic-fetch](https://github.com/matthew-andrews/isomorph
2832

2933
## Difference from client-side fetch
3034

31-
- See [Known Differences](https://github.com/bitinn/node-fetch/blob/master/LIMITS.md) for details.
35+
- See [Known Differences](https://github.com/npm/node-fetch-npm/blob/master/LIMITS.md) for details.
3236
- If you happen to use a missing feature that `window.fetch` offers, feel free to open an issue.
3337
- Pull requests are welcomed too!
3438

3539

3640
## Install
3741

3842
```sh
39-
$ npm install node-fetch --save
43+
$ npm install node-fetch-npm --save
4044
```
4145

4246

@@ -120,7 +124,7 @@ fetch('http://httpbin.org/post', { method: 'POST', body: stream })
120124
// post with JSON
121125

122126
var body = { a: 1 };
123-
fetch('http://httpbin.org/post', {
127+
fetch('http://httpbin.org/post', {
124128
method: 'POST',
125129
body: JSON.stringify(body),
126130
headers: { 'Content-Type': 'application/json' },
@@ -158,7 +162,7 @@ fetch('http://httpbin.org/post', { method: 'POST', body: form, headers: form.get
158162
})();
159163
```
160164

161-
See [test cases](https://github.com/bitinn/node-fetch/blob/master/test/test.js) for more examples.
165+
See [test cases](https://github.com/npm/node-fetch-npm/blob/master/test/test.js) for more examples.
162166

163167

164168
## API
@@ -186,7 +190,7 @@ The default values are shown after each option key.
186190
body: null, // request body. can be null, a string, a Buffer, a Blob, or a Node.js Readable stream
187191
redirect: 'follow', // set to `manual` to extract redirect headers, `error` to reject redirect
188192

189-
// The following properties are node-fetch extensions
193+
// The following properties are node-fetch-npm extensions
190194
follow: 20, // maximum redirect count. 0 to not follow redirect
191195
timeout: 0, // req/res timeout in ms, it resets on redirect. 0 to disable (OS limit applies)
192196
compress: true, // support gzip/deflate content encoding. false to disable
@@ -205,7 +209,7 @@ Header | Value
205209
`Accept` | `*/*`
206210
`Connection` | `close` _(when no `options.agent` is present)_
207211
`Content-Length` | _(automatically calculated, if possible)_
208-
`User-Agent` | `node-fetch/1.0 (+https://github.com/bitinn/node-fetch)`
212+
`User-Agent` | `node-fetch-npm/1.0 (+https://github.com/npm/node-fetch-npm)`
209213

210214
<a id="class-request"></a>
211215
### Class: Request
@@ -224,7 +228,7 @@ Due to the nature of Node.js, the following properties are not implemented at th
224228
- `integrity`
225229
- `keepalive`
226230

227-
The following node-fetch extension properties are provided:
231+
The following node-fetch-npm extension properties are provided:
228232

229233
- `follow`
230234
- `compress`
@@ -249,7 +253,7 @@ In most cases, directly `fetch(url, options)` is simpler than creating a `Reques
249253

250254
An HTTP(S) response. This class implements the [Body](#iface-body) interface.
251255

252-
The following properties are not implemented in node-fetch at this moment:
256+
The following properties are not implemented in node-fetch-npm at this moment:
253257

254258
- `Response.error()`
255259
- `Response.redirect()`
@@ -310,7 +314,7 @@ const copyOfHeaders = new Headers(headers);
310314

311315
`Body` is an abstract interface with methods that are applicable to both `Request` and `Response` classes.
312316

313-
The following methods are not yet implemented in node-fetch at this moment:
317+
The following methods are not yet implemented in node-fetch-npm at this moment:
314318

315319
- `formData()`
316320

@@ -320,7 +324,7 @@ The following methods are not yet implemented in node-fetch at this moment:
320324

321325
* Node.js [`Readable` stream][node-readable]
322326

323-
The data encapsulated in the `Body` object. Note that while the [Fetch Standard][whatwg-fetch] requires the property to always be a WHATWG `ReadableStream`, in node-fetch it is a Node.js [`Readable` stream][node-readable].
327+
The data encapsulated in the `Body` object. Note that while the [Fetch Standard][whatwg-fetch] requires the property to always be a WHATWG `ReadableStream`, in node-fetch-npm it is a Node.js [`Readable` stream][node-readable].
324328

325329
#### body.bodyUsed
326330

@@ -343,15 +347,15 @@ Consume the body and return a promise that will resolve to one of these formats.
343347

344348
#### body.buffer()
345349

346-
<small>*(node-fetch extension)*</small>
350+
<small>*(node-fetch-npm extension)*</small>
347351

348352
* Returns: <code>Promise&lt;Buffer&gt;</code>
349353

350354
Consume the body and return a promise that will resolve to a Buffer.
351355

352356
#### body.textConverted()
353357

354-
<small>*(node-fetch extension)*</small>
358+
<small>*(node-fetch-npm extension)*</small>
355359

356360
* Returns: <code>Promise&lt;String&gt;</code>
357361

@@ -360,7 +364,7 @@ Identical to `body.text()`, except instead of always converting to UTF-8, encodi
360364
<a id="class-fetcherror"></a>
361365
### Class: FetchError
362366

363-
<small>*(node-fetch extension)*</small>
367+
<small>*(node-fetch-npm extension)*</small>
364368

365369
An operational error in the fetching process. See [ERROR-HANDLING.md][] for more info.
366370

@@ -374,13 +378,13 @@ MIT
374378
Thanks to [github/fetch](https://github.com/github/fetch) for providing a solid implementation reference.
375379

376380

377-
[npm-image]: https://img.shields.io/npm/v/node-fetch.svg?style=flat-square
378-
[npm-url]: https://www.npmjs.com/package/node-fetch
379-
[travis-image]: https://img.shields.io/travis/bitinn/node-fetch.svg?style=flat-square
380-
[travis-url]: https://travis-ci.org/bitinn/node-fetch
381-
[codecov-image]: https://img.shields.io/codecov/c/github/bitinn/node-fetch.svg?style=flat-square
382-
[codecov-url]: https://codecov.io/gh/bitinn/node-fetch
383-
[ERROR-HANDLING.md]: https://github.com/bitinn/node-fetch/blob/master/ERROR-HANDLING.md
381+
[npm-image]: https://img.shields.io/npm/v/node-fetch-npm.svg?style=flat-square
382+
[npm-url]: https://www.npmjs.com/package/node-fetch-npm
383+
[travis-image]: https://img.shields.io/travis/npm/node-fetch-npm.svg?style=flat-square
384+
[travis-url]: https://travis-ci.org/npm/node-fetch-npm
385+
[codecov-image]: https://img.shields.io/codecov/c/github/npm/node-fetch-npm.svg?style=flat-square
386+
[codecov-url]: https://codecov.io/gh/npm/node-fetch-npm
387+
[ERROR-HANDLING.md]: https://github.com/npm/node-fetch-npm/blob/master/ERROR-HANDLING.md
384388
[whatwg-fetch]: https://fetch.spec.whatwg.org/
385389
[response-init]: https://fetch.spec.whatwg.org/#responseinit
386390
[node-readable]: https://nodejs.org/api/stream.html#stream_readable_streams

UPGRADE-GUIDE.md

Lines changed: 0 additions & 109 deletions
This file was deleted.

0 commit comments

Comments
 (0)