@fizzygalacticus/trythis

1.0.2 • Public • Published

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

/@fizzygalacticus/trythis/

    Package Sidebar

    Install

    npm i @fizzygalacticus/trythis

    Weekly Downloads

    1

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    5.13 kB

    Total Files

    8

    Last publish

    Collaborators

    • fizzygalacticus