|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- # bail
-
- [![Build][build-badge]][build]
- [![Coverage][coverage-badge]][coverage]
- [![Downloads][downloads-badge]][downloads]
- [![Size][size-badge]][size]
-
- :warning: Throw a given error.
-
- ## Install
-
- [npm][]:
-
- ```sh
- npm install bail
- ```
-
- ## Use
-
- ```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]: 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
|