Simple fetch library for nodejs
npm i buco
// ES6
import buco from 'buco';
// commonjs
const buco = require('buco');
async function test() {
const data = await buco.get("https://zenquotes.io/api/random");
console.log(JSON.parse(data));
}
test();
buco.get("https://zenquotes.io/api/random").then(data => {
console.log(JSON.parse(data));
});
async function test() {
const data = await buco.get("https://zenquotes.io/api/random").json();
console.log(data);
}
test();
async function test() {
const data = await buco.get("https://zenquotes.io/api/random", {
json: true
});
console.log(data);
}
test();
async function test() {
const data = await buco.post(`https://is.gd/create.php?format=json&url=https://github.com/Axorax/buco.js`).json();
console.log(data);
}
test()