Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/magicdawn/log-reject-error
Dead Simple unhandledRejection handler
https://github.com/magicdawn/log-reject-error
loud-rejection promise reject unhandled-rejection
Last synced: 12 days ago
JSON representation
Dead Simple unhandledRejection handler
- Host: GitHub
- URL: https://github.com/magicdawn/log-reject-error
- Owner: magicdawn
- License: mit
- Created: 2017-03-10T08:08:01.000Z (almost 8 years ago)
- Default Branch: main
- Last Pushed: 2024-05-23T09:19:54.000Z (9 months ago)
- Last Synced: 2024-12-28T11:17:39.845Z (about 1 month ago)
- Topics: loud-rejection, promise, reject, unhandled-rejection
- Language: JavaScript
- Size: 24.4 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# log-reject-error
> Dead Simple unhandledRejection handler[![Build Status](https://img.shields.io/travis/magicdawn/log-reject-error.svg?style=flat-square)](https://travis-ci.org/magicdawn/log-reject-error)
[![Coverage Status](https://img.shields.io/codecov/c/github/magicdawn/log-reject-error.svg?style=flat-square)](https://codecov.io/gh/magicdawn/log-reject-error)
[![npm version](https://img.shields.io/npm/v/log-reject-error.svg?style=flat-square)](https://www.npmjs.com/package/log-reject-error)
[![npm downloads](https://img.shields.io/npm/dm/log-reject-error.svg?style=flat-square)](https://www.npmjs.com/package/log-reject-error)
[![npm license](https://img.shields.io/npm/l/log-reject-error.svg?style=flat-square)](http://magicdawn.mit-license.org)## Note
Use this module in start of Application / Script / Framework, not in any library.
Just like [loud-rejection](https://github.com/sindresorhus/loud-rejection) do.## Install
```sh
$ npm i log-reject-error --save
```## API
```js
const logRejectError = require('log-reject-error')
logRejectError(log) // log defaults to `console.error`
```### `register`
```js
require('log-reject-error/register')// equals to
require('log-reject-error')()// convenient for ES6 import
import 'log-reject-error/register'
```## Changelog
[CHANGELOG.md](CHANGELOG.md)## License
the MIT License http://magicdawn.mit-license.org