try-call

0.0.2 • Public • Published

try-call

Functional try-catch for cleaner code & optimization.

Install

$ npm install try-call

Usage

var call = require('try-call');
 
var doc = '{ "foo": 123 }';
var parse = JSON.parse.bind(null, doc);
 
call(parse, function (error, doc) {
  error
  // => undefined
 
  doc
  // => { foo: 123}
})

Readme

Keywords

Package Sidebar

Install

npm i try-call

Weekly Downloads

588

Version

0.0.2

License

BSD

Last publish

Collaborators

  • nmjohnson