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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 3.0.1
    39,764
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 3.0.1
    39,764
  • 3.0.0
    7,792
  • 2.0.1
    13,173
  • 2.0.0
    10,135
  • 1.0.0
    729

Package Sidebar

Install

npm i try-catch

Weekly Downloads

43,856

Version

3.0.1

License

MIT

Unpacked Size

4.16 kB

Total Files

5

Last publish

Collaborators

  • coderaiser