micro-notify
Version:
A simple wrapper to send micro errors to Bugsnag
55 lines (35 loc) • 1.79 kB
Markdown
# micro-notify
[](https://codeclimate.com/github/pauldariye/micro-notify/maintainability)[](https://codeclimate.com/github/pauldariye/micro-notify/test_coverage)[](https://travis-ci.org/pauldariye/micro-notify)[](https://david-dm.org/pauldariye/micro-notify) [](https://david-dm.org/pauldariye/micro-notify?type=dev)
A simple [`.notify`](https://github.com/bugsnag/bugsnag-js) wrapper to send micro errors to Bugsnag.
## Usage
```bash
yarn add micro-notify # or npm install micro-notify
```
## Basic Example
```javascript
const notify = require('micro-notify')
const key = 'YOUR BUG SNAG API KEY'
module.exports = notify(key)(async (req, res) => {
throw Error('Test micro-notify')
})
```
## Example with options
```javascript
const notify = require('micro-notify')
const key = 'YOUR BUG SNAG API KEY'
module.exports = notify(key, { autoNotify: true })(async (req, res) => {
throw Error('Test micro-notify')
})
```
## Development
```
git clone git@github.com:pauldariye/micro-notify.git
cd micro-notify && yarn # or npm install
yarn test
```
## Acknowledgements
- [micro-sentry](https://github.com/tanmulabs/micro-sentry)
- [micro-boom](https://github.com/onbjerg/micro-boom)
- [npm-module-boilerplate](https://github.com/flexdinesh/npm-module-boilerplate)
## License
MIT