Skip to content

FizzyGalacticus/trythis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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: sync-output

asynchronous:

trythis(() => Promise.resolve(`this shouldn't throw`))(/* ...params */);
trythis(() => Promise.reject('this should throw'))(/* ...params */);

output: async-output

About

A util to help trace errors in JavaScript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published