Détail du package

try-call

n-johnson2.9kBSD0.0.2

Functional try-catch

try, catch, optimization

readme

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