json-parse-async

1.0.3 • Public • Published

json-parse-async

Last version Build Status Dependency status Dev Dependencies Status NPM Status Donate

The missing JSON.parse async interface.

Install

npm install json-parse-async --save

If you want to use in the browser (powered by Browserify):

bower install json-parse-async --save

and later link in your HTML:

<script src="bower_components/json-parse-async/dist/json-parse-async.js"></script>

Usage

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

License

MIT © Kiko Beats

Readme

Keywords

Package Sidebar

Install

npm i json-parse-async

Weekly Downloads

33

Version

1.0.3

License

MIT

Last publish

Collaborators

  • kikobeats