# tx2

> Metrics, Issues, Actions, Events reporting library

Latest version **1.0.5** (published 2021-11-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install tx2
pnpm add tx2
yarn add tx2
bun add tx2
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2021-11-21 |
| First published | 2021-01-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/tx2) |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 34.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | PM2 |
| Maintainers | tknew |

## Links

- npm: https://www.npmjs.com/package/tx2
- npm.io page: https://npm.io/package/tx2

## Dependencies (1)

- [json-stringify-safe](https://npm.io/package/json-stringify-safe.md) ^5.0.1

## Recent versions

- 1.0.5 (latest) — 2021-11-21
- 1.0.4 — 2021-02-02
- 1.0.3 — 2021-01-18

## README

## tx2

Report Events, Metrics, Issues, Actions to PM2 and PM2.io.

```javascript
const tx2 = require('tx2')

let body = { calories : 20 }
tx2.metric('burnt calories', () => body.calories)

tx2.action('lift weights', (cb) => {
  cb({ success: true })
})
```

Check [API.md](API.md) for full API doc.

Once you have created some metrics:

```bash
$ pm2 start app.js
```

Then run:

```bash
# Inspect primitive reported
$ pm2 show app
```

or go to pm2.io for web based interface + insights creation.

## More

Generate documentation:

```bash
$ npm run doc
```

## License

MIT

---
_Source: https://npm.io/package/tx2 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
