@yolean/promparse
v1.0.0
Published
This is a super primitive Prometheus text format parser, created as an example of how we can share a lib between Deno and Node.
Downloads
1
Readme
promparse
This is a super primitive Prometheus text format parser, created as an example of how we can share a lib between Deno and Node.
There are other Prometheus parsers.
boilerplate
npm install --save-dev --save-exact --ignore-scripts jest typescript @tsconfig/deno ts-jest @types/jest
./node_modules/.bin/ts-jest config:init
use from Deno
#!/usr/bin/env -S deno run --allow-net
// TODO insert git ref instead of master here
import promparse from 'https://github.com/Yolean/promparse/raw/master/src/promparse.ts';
const scrape = await fetch('http://localhost:8080/metrics');
console.log(promparse(await scrape.text()));
use from Node
npm install @yolean/promparse