Files
vanillajs-seed/node_modules/try-catch
2019-12-20 20:02:44 +01:00
..
2019-04-15 11:34:09 +02:00
2019-12-20 20:02:44 +01:00
2019-04-15 11:34:09 +02:00
2019-12-20 20:02:44 +01:00
2019-12-20 20:02:44 +01:00

Try Catch License NPM version Dependency Status 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);

License

MIT