try-catch
try-catch wrapper
Last updated 10 years ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install try-catch 
SYNC missed versions from official npm registry.

Try Catch License NPM version Build Status Coverage Status

Functional try-catch wrapper

Install

npm i try-catch

Example

const tryCatch = require('try-catch');
const {parse} = JSON;
const [error, result] = tryCatch(parse, 'hello');

if (error)
    console.error(error.message);

Related

License

MIT

Current Tags

  • 3.0.1                                ...           latest (3 years ago)

5 Versions

  • 3.0.1                                ...           3 years ago
  • 3.0.0                                ...           5 years ago
  • 2.0.1                                ...           5 years ago
  • 2.0.0                                ...           7 years ago
  • 1.0.0                                ...           10 years ago

© 2010 - cnpmjs.org x YWFE | Home | YWFE