New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

await-error-handle

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

await-error-handle

Simplify handling async errors

latest
Source
npmnpm
Version
1.0.12
Version published
Maintainers
1
Created
Source

await-error-handle

Codecov Coverage GitHub

Purpose

await-error-handle is a package designed to simplify handling errors that come back when you await an async function.

Installation

Add to your project using npm i -S await-error-handle

Usage

import errorHandle from 'await-error-handle';

const [err, res] = await errorHandle(Promise.resolve('yay'));

// err = null
// res = 'yay'
import errorHandle from 'await-error-handle';

const [err, res] = await errorHandle(Promise.reject(new Error('boo')));

// err = [Error boo]
// res = undefined

Keywords

await

FAQs

Package last updated on 07 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts