Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including jsonstat with all npm packages installed. Try it out:

//Tonic Example File. For https://tonicdev.com const JSONstat = require('jsonstat'), got = require("got"), unr = function(arr){ got( "https://json-stat.org/samples/oecd.json" ) .then(response => { var ds = JSONstat(JSON.parse(response.body)); if(ds.length){ arr.forEach(o => { var value = ds.Data(o).value, label = (d => { return ds.Dimension(d).Category(o[d]).label; }) ; console.log( "Unemployment rate in " + label("area") + " in " + label("year") + " was " + value + " %." ); }); }else{ console.log("Response is not valid JSON-stat."); } }) .catch(error => { console.log(error.response.body); }) ; } ; //Time: 2003-2014 Geo: AU, AT, BE, CA... unr([ {year: "2003", area: "DE"}, {year: "2003", area: "GR"} ]);

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

jsonstat v0.13.13

JavaScript library to deal with JSON-stat responses.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free