# bail

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]

:warning: Throw a given error.

## Installation

[npm][npm-install]:

```bash
npm install bail
```

## Usage

```js
var bail = require('bail')

bail()

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

## API

### `bail([err])`

Throw a given error.

###### Parameters

*   `err` (`Error?`) — Optional error.

###### Throws

*   `Error` — Given error, if any.

## Related

*   [`noop`][noop]
*   [`noop2`][noop2]
*   [`noop3`][noop3]

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[build-badge]: https://img.shields.io/travis/wooorm/bail.svg

[build]: https://travis-ci.org/wooorm/bail

[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/bail.svg

[coverage]: https://codecov.io/github/wooorm/bail

[downloads-badge]: https://img.shields.io/npm/dm/bail.svg

[downloads]: https://www.npmjs.com/package/bail

[size-badge]: https://img.shields.io/bundlephobia/minzip/bail.svg

[size]: https://bundlephobia.com/result?p=bail

[npm-install]: https://docs.npmjs.com/cli/install

[license]: license

[author]: https://wooorm.com

[noop]: https://www.npmjs.com/package/noop

[noop2]: https://www.npmjs.com/package/noop2

[noop3]: https://www.npmjs.com/package/noop3
