Socket
Book a DemoInstallSign in
Socket

bail

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bail

Throw a given error

Source
npmnpm
Version
2.0.1
Version published
Weekly downloads
7.6M
-23.71%
Maintainers
1
Weekly downloads
 
Created
Source

bail

Build Coverage Downloads Size

:warning: Throw a given error.

Install

This package is ESM only: Node 12+ is needed to use it and it must be imported instead of required.

npm:

npm install bail

Use

import {bail} from 'bail'

bail()

bail(new Error('failure'))
// Error: failure
//     at repl:1:6
//     at REPLServer.defaultEval (repl.js:154:27)
//     …

API

This package exports the following identifiers: bail. There is no default export.

bail([err])

Throw a given error.

Parameters
  • err (Error?) — Optional error.
Throws
  • Error — Given error, if any.

License

MIT © Titus Wormer

Keywords

fail

FAQs

Package last updated on 26 Mar 2021

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