try-catch
v3.0.1
Published
functional try-catch wrapper
Downloads
239,379
Readme
Try Catch
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
- try-to-catch - functional try-catch wrapper for promises.
License
MIT