Chainfetch
Snek 🐍 Chain your request together with this package!
Wraps around node-fetch to provide you a easier API for it, to ease up migrating to it.
Getting Started
First off, you need to install the module! To do so,
npm i chainfetch
yarn add chainfetch
And then you're ready to roll! Or...chain.
Usage
The following examples assume you are in the context of an async function. All return functions return a promise for you to use.
const fetch = require('chainfetch');
const res = await fetch.get('https://example.com').toBuffer();
For posting data, you can do something similar to this
const fetch = require('chainfetch');
const res = await fetch.post('https://example.com').query({ isSimple: true }).query('isAmazing', true).send({ string: 'chainfetch is simple and amazing!' }).toJSON();