Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fetch is now available as a polyfill or a self-contained library #192

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.env
bower_components/
library/
node_modules/
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
build: node_modules/ bower_components/
build: node_modules/ bower_components/ compile/

test: node_modules/ build lint
./script/test

lint: node_modules/
./node_modules/.bin/jshint *.js test/*.js
./node_modules/.bin/jshint src/*.js test/*.js

bower_components/: node_modules/
./node_modules/.bin/bower install

compile/: node_modules/
./node_modules/.bin/webpack --output-library-target commonjs2 src/fetch.js library/index.js
./node_modules/.bin/webpack -p src/index.js ./fetch.js

node_modules/:
npm install

clean:
rm -rf ./bower_components ./node_modules
rm -rf ./bower_components ./library ./node_modules

.PHONY: build clean lint test saucelabs travis
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ This can also be installed with `npm`.
$ npm install whatwg-fetch --save
```

You have two options when using the npm module:

```
require('whatwg-fetch'); // Polyfills self.fetch
var fetch = require('whatwg-fetch/library'); // Returns an implementation
```

(For a node.js implementation, try [node-fetch](https://github.com/bitinn/node-fetch))

## Usage
Expand Down
350 changes: 1 addition & 349 deletions fetch.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading