fetchu.js
v1.0.1
Published
A simple and modern fetch wrapper for Node.js
Maintainers
Readme
fetchu.js
A simple and modern fetch wrapper for Node.js
Installation
npm install fetchu.jsUsage
const { request, RequestMethod } = require('fetchu.js');
request('https://example.com', {
method: RequestMethod.Get,
headers: {
'Content-Type': 'application/json'
},
body: {
foo: 'bar'
}
}, {
isOk: (response) => console.log(`API responded successful ${response.status} ${response.statusText}!`),
isNotOk: (response) => console.log(`API responded unsuccessful ${response.status} ${response.statusText}!`)
});