safe-try

0.0.4 • Public • Published

safe-try

Want this?

const [result, error] = try await asyncMightFail();

Do this!

const [result, error] = await try_(asyncMightFail());

Inspired by Matt Pocock's tweet:

tweet-1823822755562967230

Usage

import { try_ } from "safe-try";
const [result, error] = await try_(asyncMightFail());

Readme

Keywords

Package Sidebar

Install

npm i safe-try

Weekly Downloads

10

Version

0.0.4

License

MIT

Unpacked Size

3.07 kB

Total Files

5

Last publish

Collaborators

  • mmiszy