https://github.com/tiagogm/micro-trackjs
A tiny middleware to send errors to trackjs from zeit's micro framework
https://github.com/tiagogm/micro-trackjs
logging micro trackjs
Last synced: 5 months ago
JSON representation
A tiny middleware to send errors to trackjs from zeit's micro framework
- Host: GitHub
- URL: https://github.com/tiagogm/micro-trackjs
- Owner: tiagogm
- License: mit
- Created: 2019-12-27T13:16:36.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T13:16:27.000Z (over 3 years ago)
- Last Synced: 2025-02-03T21:30:09.326Z (over 1 year ago)
- Topics: logging, micro, trackjs
- Language: JavaScript
- Size: 1.39 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# micro-trackjs
`micro-trackjs` allows you to send [`micro`](https://github.com/zeit/micro) errors to [TrackJS](https://trackjs.com).
This little library was inspired it's "siblings" here:
https://github.com/amio/awesome-micro#loggers-errors--reporting
## Usage
```sh
npm i micro-trackjs
```
## Basic Example
```js
const trackjs = require("micro-trackjs");
const token = "your trackjs app token";
module.exports = trackjs(token)(async (req, res) => {
throw Error("hello micro-trackjs");
});
```
## Example with options
See docs for full options:
https://docs.trackjs.com/node-agent/sdk-reference/agent-options/
```javascript
const trackjs = require("micro-trackjs");
const token = "your trackjs app token";
module.exports = trackjs(key, { application: "my-application" })(
async (req, res) => {
throw Error("hellow micro-trackjs");
}
);
```
## Development
```
git clone git@github.com:pauldariye/micro-trackjs.git
cd micro-trackjs && yarn # or npm install
yarn test
```
## Acknowledgements
- [micro-notify](https://github.com/pauldariye/micro-notify)
- [micro-sentry](https://github.com/tanmulabs/micro-sentry)
## License
MIT