try-catch
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/try-catch package

3.0.1 • Public • Published

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

Dependencies (0)

    Dev Dependencies (7)

    Package Sidebar

    Install

    npm i try-catch

    Weekly Downloads

    35,377

    Version

    3.0.1

    License

    MIT

    Unpacked Size

    4.16 kB

    Total Files

    5

    Last publish

    Collaborators

    • coderaiser