Functional try-catch wrapper
npm i try-catch
import{tryCatch}from'try-catch';const{parse}=JSON;const[error,result]=tryCatch(parse,'hello');if(error)console.error(error.message);- try-to-catch - functional try-catch wrapper for promises.
MIT
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Latest commit | ||||
Functional try-catch wrapper
npm i try-catch
import{tryCatch}from'try-catch';const{parse}=JSON;const[error,result]=tryCatch(parse,'hello');if(error)console.error(error.message);MIT