Package Exports
- get-json
- get-json/lib/browser.js
- get-json/lib/node.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (get-json) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
get-json
Cross-platform library for getting JSON documents. Wraps request on Node, fallsback to JSONP on browsers.
$ npm install get-jsonUsage
var getJSON = require('get-json')
getJSON('http://api.listenparadise.org', function(error, response){
console.log(error);
// undefined
console.log(response);
// ["Beth Orton — Stolen Car",
// "Jack White — Temporary Ground",
// "I Am Kloot — Loch",
// "Portishead — Glory Box"]
});Alternatively, you can use a Promise:
var getJSON = require('get-json')
getJSON('http://api.listenparadise.org')
.then(function(response) {
console.log(response);
}).catch(function(error) {
console.log(error);
});