|
|
vor 5 Tagen | |
|---|---|---|
| .. | ||
| lib | vor 5 Tagen | |
| ChangeLog | vor 5 Tagen | |
| LICENSE | vor 5 Tagen | |
| README.md | vor 5 Tagen | |
| package.json | vor 5 Tagen | |
Functional try-catch wrapper
npm i try-catch
const tryCatch = require('try-catch');
const {parse} = JSON;
const [error, result] = tryCatch(parse, 'hello');
if (error)
console.error(error.message);
MIT