# prom2javascript

> A library to convert Prometheus metrics from text to JavaScript.

Latest version **0.2.0** (published 2021-09-15) · MIT license · 0 weekly downloads

## Install

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

## Health

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

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

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2021-09-15 |
| First published | 2021-09-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 13.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Alessandro Scotti |
| Maintainers | ascotti-beyond |
| Keywords | prometheus, metrics, openmetrics |

## Links

- npm: https://www.npmjs.com/package/prom2javascript
- Repository: https://github.com/it-beyondit/prom2javascript
- Homepage: https://github.com/it-beyondit/prom2javascript#readme
- Issues: https://github.com/it-beyondit/prom2javascript/issues
- npm.io page: https://npm.io/package/prom2javascript

## Recent versions

- 0.2.0 (latest) — 2021-09-15
- 0.1.0 — 2021-09-14

## README

# prom2javascript

A library to convert Prometheus metrics from text to JavaScript.

## Usage

Install:
```
npm i prom2javascript
```

Example with stream:
```
import { getMetricsFromStream } from 'prom2javascript';

const metrics = await getMetricsFromStream(fs.createReadStream('metrics.txt'));
```

Example with iterator:
```
import { getMetricsFromIterator } from 'prom2javascript';

const input = function* () {
    yield 'foo 3.14';
}

const metrics = await getMetricsFromIterator(input());
```

More examples in the `test/unit` directory.

## License

MIT.

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