Skip to content

Latest commit

 

History

History
38 lines (26 loc) · 1.21 KB

File metadata and controls

38 lines (26 loc) · 1.21 KB

Try Catch License NPM version Build Status Coverage Status

Functional try-catch wrapper

Install

npm i try-catch

Example

import {tryCatch} from 'try-catch';

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

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

Related

License

MIT