p-try
Install
$ npm install p-tryUsage
const pTry = require('p-try');
(async () => {
try {
const value = await pTry(() => {
return synchronousFunctionThatMightThrow();
});
console.log(value);
} catch (error) {
console.error(error);
}
})();API
pTry(fn, ...arguments)
fn
arguments
Related
License
Last updated