runcatching
A Node.js module that runs the code in try-catch block and wraps the result in either ErrorResult or SuccessResult
Installation
npm install runcatching --saveyarn add runcatchingbower install runcatching --save
Usage
Javascript
{ const result = await AuthService; if result return ; return resultpayload;} // AuthService.js { return await ;}
TypeScript
// AuthService.js
Test
npm run test