try-catch

functional try-catch wrapper


Keywords
catch, javascript, nodejs, try-catch
License
MIT
Install
npm install try-catch@3.0.1

Documentation

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