1.1.0 • Published 6 years ago
simple-fetch-json v1.1.0
simple-fetch-json
Simple fetch api for json
Information
For now only supports GET method
Installation
npm: npm install simple-fetch-json --save
yarn: yarn add simple-fetch-json
Usage
Promise
const fetchJSON = require("fetch-json");
fetchJSON("https://jsonplaceholder.typicode.com/posts/1")
.then(data => console.log(data));
Callback
const fetchJSON = require("fetch-json");
fetchJSON("https://jsonplaceholder.typicode.com/posts/1", data => console.log(data));