Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

simple-fetch-json

MineGame15921MIT1.1.0

Simple fetch api for json

fetch, json

readme

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));