You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Haha-Yes/node_modules/snekfetch
Loïc Bersier 7b16ff8092 haha yes 6 years ago
..
.github haha yes 6 years ago
scripts haha yes 6 years ago
src haha yes 6 years ago
test haha yes 6 years ago
.eslintrc.json haha yes 6 years ago
.travis.yml haha yes 6 years ago
CODE_OF_CONDUCT.md haha yes 6 years ago
CONTRIBUTING.md haha yes 6 years ago
LICENSE haha yes 6 years ago
README.md haha yes 6 years ago
browser.js haha yes 6 years ago
docs.js haha yes 6 years ago
esm.mjs haha yes 6 years ago
index.js haha yes 6 years ago
package.json haha yes 6 years ago
sync.js haha yes 6 years ago
webpack.config.js haha yes 6 years ago

README.md

npm David Coverage Status Build Status

NPM

snekfetch Version Badge

Snekfetch 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.4kb.

Documentation is available at https://snekfetch.js.org/

Some examples

const request = require('snekfetch');

request.post('https://httpbin.org/post')
  .send({ usingGoodRequestLibrary: true })
  .then(r => console.log(r.body)); // r.body is object from json response

request.get('https://s.gc.gy/o-SNAKES.jpg')
  .then(r => fs.writeFile('download.jpg', r.body)); // r.body is buffer

request.get('https://s.gc.gy/o-SNAKES.jpg')
  .pipe(fs.createWriteStream('download.jpg')); // pipes

Available for browser as UMD from unpkg

<script src=https://unpkg.com/snekfetch></script>