snekfetch
Version:
Just do http requests without all that weird nastiness from other libs
48 lines (35 loc) • 1.69 kB
Markdown
[![npm][download-badge]][npm]
[![David][dep-badge]][dep-link]
[![Coverage Status][coverage-badge]][coverage-link]
[![Build Status][build-badge]][build-link]
[![NPM][large-badge]][stats-link]
is a fast, efficient, and user-friendly library for making HTTP requests.
The API was inspired by superagent, however it is much smaller and faster.
In fact, in browser, it is a mere 4.6kb.
Documentation is available at https://snekfetch.js.org/
```javascript
const snekfetch = require('snekfetch');
snekfetch.get('https://s.gus.host/o-SNAKES-80.jpg')
.then(r => fs.writeFile('download.jpg', r.body));
snekfetch.get('https://s.gus.host/o-SNAKES-80.jpg')
.pipe(fs.createWriteStream('download.jpg'));
```
```javascript
const snekfetch = require('snekfetch');
snekfetch.post('https://httpbin.org/post')
.send({ meme: 'dream' })
.then(r => console.log(r.body));
```
[ ]: https://npmjs.org/package/snekfetch
[ ]: https://nodei.co/npm/snekfetch.png?downloads=true&downloadRank=true&stars=true
[ ]: https://nodei.co/npm/snekfetch/
[ ]: http://versionbadg.es/devsnek/snekfetch.svg
[ ]: https://img.shields.io/npm/dt/snekfetch.svg?maxAge=3600
[ ]: https://api.travis-ci.org/devsnek/snekfetch.svg?branch=master
[ ]: https://travis-ci.org/devsnek/snekfetch
[ ]: https://david-dm.org/guscaplan/snekfetch.svg
[ ]: https://david-dm.org/guscaplan/snekfetch
[ ]: https://coveralls.io/repos/github/devsnek/snekfetch/badge.svg?branch=master
[ ]: https://coveralls.io/github/devsnek/snekfetch?branch=master
Snekfetch