1 | [![npm][download-badge]][npm]
|
2 | [![David][dep-badge]][dep-link]
|
3 | [![Coverage Status][coverage-badge]][coverage-link]
|
4 | [![Build Status][build-badge]][build-link]
|
5 |
|
6 | [![NPM][large-badge]][stats-link]
|
7 |
|
8 | # snekfetch <sup>[![Version Badge][version-badge]][npm]</sup>
|
9 |
|
10 | Snekfetch is a fast, efficient, and user-friendly library for making HTTP requests.
|
11 |
|
12 | The API was inspired by superagent, however it is much smaller and faster.
|
13 | In fact, in browser, it is a mere 4.6kb.
|
14 |
|
15 | Documentation is available at https://snekfetch.js.org/
|
16 |
|
17 | ## Some examples
|
18 |
|
19 | ```javascript
|
20 | const snekfetch = require('snekfetch');
|
21 |
|
22 | snekfetch.get('https://s.gus.host/o-SNAKES-80.jpg')
|
23 | .then(r => fs.writeFile('download.jpg', r.body));
|
24 |
|
25 | snekfetch.get('https://s.gus.host/o-SNAKES-80.jpg')
|
26 | .pipe(fs.createWriteStream('download.jpg'));
|
27 | ```
|
28 |
|
29 | ```javascript
|
30 | const snekfetch = require('snekfetch');
|
31 |
|
32 | snekfetch.post('https://httpbin.org/post')
|
33 | .send({ meme: 'dream' })
|
34 | .then(r => console.log(r.body));
|
35 | ```
|
36 |
|
37 | [npm]: https://npmjs.org/package/snekfetch
|
38 | [large-badge]: https://nodei.co/npm/snekfetch.png?downloads=true&downloadRank=true&stars=true
|
39 | [stats-link]: https://nodei.co/npm/snekfetch/
|
40 | [version-badge]: http://versionbadg.es/devsnek/snekfetch.svg
|
41 | [download-badge]: https://img.shields.io/npm/dt/snekfetch.svg?maxAge=3600
|
42 | [build-badge]: https://api.travis-ci.org/devsnek/snekfetch.svg?branch=master
|
43 | [build-link]: https://travis-ci.org/devsnek/snekfetch
|
44 | [dep-badge]: https://david-dm.org/guscaplan/snekfetch.svg
|
45 | [dep-link]: https://david-dm.org/guscaplan/snekfetch
|
46 | [coverage-badge]: https://coveralls.io/repos/github/devsnek/snekfetch/badge.svg?branch=master
|
47 | [coverage-link]: https://coveralls.io/github/devsnek/snekfetch?branch=master
|