0.0.2 • Published 8 years ago

try-call v0.0.2

Weekly downloads
747
License
BSD
Repository
github
Last release
8 years ago

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