@fizzygalacticus/trythis
v1.0.2 try helper debug
trythis
A util to help trace errors
Installation
Using npm
:
npm i --save-dev @fizzygalacticus/trythis
Using yarn
:
yarn add --dev @fizzygalacticus/trythis
Usage
trythis
can be used on both asynchronous and synchronous functions:
synchronous:
trythis(() => `this shouldn't throw`)(/* ...params */);
trythis(() => {throw new Error('this should throw')})(/* ...params */);
output:
asynchronous:
trythis(() => Promise.resolve(`this shouldn't throw`))(/* ...params */);
trythis(() => Promise.reject('this should throw'))(/* ...params */);
output:
npm i @fizzygalacticus/trythis
Source Code
github.com/FizzyGalacticus/t...Metadata
- MIT
- Whatever
- Dustin L. Dodson
- released 8/28/2019