The missing JSON.parse async interface.
npm install json-parse-async!Last version





> The missing JSON.parse async interface.
``bash`
npm install json-parse-async --save
If you want to use in the browser (powered by Browserify):
`bash`
bower install json-parse-async --save
and later link in your HTML:
`html`
`js
var parseJSON = require('json-parse-async');
var stringify = '{"foo":"bar"}';
// as callback interface
parseJSON(stringify, function(err, content) {
console.log(content.foo); // => 'bar'
});
// as promise interface
parseJSON(stringify)
.then(function(content) {
console.log(content.foo); // => 'bar'
})
.catch(function(err) {
console.log('promise was rejected:', err);
});
``
MIT © Kiko Beats