Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

typecatch

Simple TypeScript tryCatch util function for both sync and async

Installation

npm i typecatch

Usage

import { tryCatch } from "typecatch";

// function:
const { data, error } = tryCatch(() => JSON.parse(/* ... */));

// promise:
const { data, error } = await tryCatch(fetch(/* ... */));

About

🪤 simple typescript tryCatch util function for both sync and async

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages