node-guardian
v1.1.4
Published
Start of a new project
Downloads
203
Readme
Key benefits of using NodeGuardian.js are:
- Automatic error grouping: NodeGuardian aggregates Occurrences caused by the same error into Items that represent application issues.
- Alarm system: NodeGuardian is capable of sending emails upon detecting anomaly.
- Customizable notifications: NodeGuardian supports different notifications rules, letting users modify their notification settings based on their need.
Setup Instructions
- Sign up for a NodeGuardian account. (or you can use guest info to sign in)
- Create a project, which should give you an access token, copy this token as you will need it to authenticate your project.
- Follow instructions below to import and initialize the package.
// install package node-guardian
$ npm install node-guardian
// inside express framework, ESM only
import NodeGuardian from 'node-guardian';
const guard = new NodeGuardian({ accessToken: "< your project access token >" });
// calling next on error
try {
} catch (err) {
next(err);
}
// use it as an error handling middleware
app.use(guard.handleError());
// your own error handler
app.use(globalErrorHandler);
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
). - Commit your changes (
git commit -am 'Added some feature'
). - Push to the branch (
git push origin my-new-feature
). - Create a new Pull Request.
FAQ
Is this package ESM only?
Yes, this package right now can only be initialized using ESM.
Can I use this package outside Express framework?
No, this package now can only be used in Express's error handling middleware. Future update will release more feature and functionality.