2.0.6 • Published 3 years ago

ntn-try-me v2.0.6

Weekly downloads
10
License
MIT
Repository
github
Last release
3 years ago

ntn-try-me

npm Minified MIT

try-me is a tiny utility.
try-me help Eliminate regular, tangled and heavy try-catch-finally.
With the aim to help you with error handling. You will be able to gain the following:

  • Less code
  • A more intelligent code
  • More flexibility
  • All in Typescript
  • With ESM \ ES Modules

Get ready

npm i ntn-try-me

unpkg.com/ntn-try-me/bundle/bundle

API

Need an Example ?

import { tryMe } from 'ntn-try-me';

tryMe(() => { });
import { _try } from 'ntn-try-me'; // Lighter

_try(() => { });
import { tryMe } from 'ntn-try-me';

tryMe<MyErr>(() => Number['myFn'](), {
    valid: () => console.log('Great!'),
    fail: (e: MyErr) => console.log('Bummer...'),
    ifFailFireErr: true,
    fireErrUniqType: TypeError,
    finalize: () => console.log('We did it.')
});

In the future

  • Async
  • Fluent API
2.0.6

3 years ago

2.0.5

3 years ago

2.0.3

4 years ago

2.0.4

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

1.0.10

4 years ago

2.0.0

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago