Skip to content

Instantly share code, notes, and snippets.

@danmactough
Created May 24, 2020 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danmactough/deea92bf6f41b0d9cc8a27062787721b to your computer and use it in GitHub Desktop.
Save danmactough/deea92bf6f41b0d9cc8a27062787721b to your computer and use it in GitHub Desktop.
const fetch = require('node-fetch');
function request (options, cb) {
fetch(options)
.catch(cb)
.then(res => {
return res.body()
.then(body => {
cb(null, res, body);
}, cb);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment