Go to file
David Frank 9c472a52f2 setup repo 2015-01-26 17:02:34 +08:00
test setup repo 2015-01-26 17:02:34 +08:00
.gitignore setup repo 2015-01-26 17:02:34 +08:00
CHANGELOG.md setup repo 2015-01-26 17:02:34 +08:00
LICENSE.md setup repo 2015-01-26 17:02:34 +08:00
README.md setup repo 2015-01-26 17:02:34 +08:00
index.js setup repo 2015-01-26 17:02:34 +08:00
package.json setup repo 2015-01-26 17:02:34 +08:00

README.md

node-fetch

npm version build status

A light-weight module that brings window.fetch to node.js

Motivation

I really like the notion of Matt Andrews' isomorphic-fetch: it bridges the API gap between client-side and server-side http requests, so developers have less to worry about.

But I think the term isomorphic is generally misleading: it gives developers a false impression that their javascript code will happily run on both controlled server environment as well as uncontrollable user browsers. When the latter is only true for a subset of modern browsers, not to mention browser quirks.

Plus if you are going all the way to implement XMLHttpRequest in node and then promisify it, why not go from node's http to fetch API directly? Your browserify build are going to be vastly different from node anyway.

Features

  • Stay consistent with window.fetch API.
  • Make conscious trade-off when following WHATWG fetch spec implementation details, document known difference.
  • Use native promise, but allow substituting it with [insert your favorite promise library].

Install

npm install node-fetch --save

Usage

TODO

Limit

TODO

License

MIT