Add docs for v2.x

This commit is contained in:
Timothy Gu 2018-02-03 12:33:32 -08:00
parent b1cd2dd438
commit 44c67b11a3
No known key found for this signature in database
GPG Key ID: 7FE6B095B582B0D4
2 changed files with 3 additions and 12 deletions

View File

@ -13,7 +13,7 @@ This is a major release. Check [our upgrade guide](https://github.com/bitinn/nod
- Major: Node.js 0.10.x and 0.12.x support is dropped
- Major: `require('node-fetch/lib/response')` etc. is now unsupported; use `require('node-fetch').Response` or ES6 module imports
- Enhance: start testing on Node.js 4, 6, 8 LTS
- Enhance: start testing on Node.js v4.x, v6.x, v8.x LTS, as well as v9.x stable
- Enhance: use Rollup to produce a distributed bundle (less memory overhead and faster startup)
- Enhance: make `Object.prototype.toString()` on Headers, Requests, and Responses return correct class strings
- Other: rewrite in ES2015 using Babel
@ -26,8 +26,8 @@ This is a major release. Check [our upgrade guide](https://github.com/bitinn/nod
### HTTP requests
- Major: overwrite user's `Content-Length` if we can be sure our information is correct (per spec)
- Fix: errors in a response are caught before the body is accessed
- Fix: support WHATWG URL objects, created by `whatwg-url` package or `require('url').URL` in Node.js 7+
- Fix: a regression in older v2 build where `index.es.js` doesn't require https module, causing HTTPS request to fail (alpha.8)
### Response and Request classes

View File

@ -36,21 +36,12 @@ See Matt Andrews' [isomorphic-fetch](https://github.com/matthew-andrews/isomorph
## Install
Stable release (`1.x`)
Stable release (`2.x`)
```sh
$ npm install node-fetch --save
```
Next release (`2.x`), currently in alpha
```sh
$ npm install node-fetch@next --save
```
*Note: 2.x is expected to be in alpha for quite a while; due to Fetch Spec itself is still evolving and we try to follow its design. Many have been using 2.x for over 6 months, we consider it to be stable and ready for production.*
## Usage
Note that documentation below is up-to-date with `2.x` releases, [see `1.x` readme](https://github.com/bitinn/node-fetch/blob/1.x/README.md), [changelog](https://github.com/bitinn/node-fetch/blob/1.x/CHANGELOG.md) and [2.x upgrade guide][UPGRADE-GUIDE.md] if you want to find out the difference.