@fizzygalacticus/trythis

v1.0.2
Try anything and see what happens!
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: sync-output

asynchronous:

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

output: async-output

npm i @fizzygalacticus/trythis

Metadata

  • MIT
  • Whatever
  • Dustin L. Dodson
  • released 8/28/2019

Downloads

Maintainers