{"_id":"tsqtsq","_rev":"19-1609b79d5f050a3f78130db039291d0c","name":"tsqtsq","dist-tags":{"latest":"1.5.1"},"versions":{"1.0.0":{"name":"tsqtsq","version":"1.0.0","keywords":["prometheus","promql","typescript","query","javascript"],"author":{"name":"Grafana Labs"},"license":"AGPL-3.0-only","_id":"tsqtsq@1.0.0","maintainers":[{"name":"jewbetcha","email":"crollins199@gmail.com"}],"homepage":"https://github.com/grafana/tsqtsq#readme","bugs":{"url":"https://github.com/grafana/tsqtsq/issues"},"dist":{"shasum":"43d3e8d5ab9ad6e43373349e24353497ee025f94","tarball":"https://registry.npmjs.org/tsqtsq/-/tsqtsq-1.0.0.tgz","fileCount":21,"integrity":"sha512-rv13LCCSijK1UDdprekEBn7ZyEIE6SneKVBGCYX1yYGTSdrJGWKjfbhAT6iH9SoZl3RsuPuHB1rKSS56RCR7gw==","signatures":[{"sig":"MEUCIQCeC1fjbcEDukPMEBxQ/asuvBT6XMgGliSHX15n2AgHDQIgdFHwD8dovTqzuVkCBB//7drTS2b8fhjLeiBuYZoAIak=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":79851},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"91e4146ee34c22dcdf5ead8ddc1e7dec13c90bc7","scripts":{"test":"jest","build":"esbuild src/index.js --bundle --platform=node --outfile=dist/index.js ","test:watch":"jest --watch"},"_npmUser":{"name":"jewbetcha","email":"crollins199@gmail.com"},"repository":{"url":"git+https://github.com/grafana/tsqtsq.git","type":"git"},"_npmVersion":"10.5.0","description":"A reusable and composable query library for Prometheus","directories":{},"_nodeVersion":"18.20.2","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","esbuild":"^0.23.0","ts-jest":"^29.2.4","typescript":"^5.5.4","@types/jest":"^29.5.12"},"_npmOperationalInternal":{"tmp":"tmp/tsqtsq_1.0.0_1732559827756_0.6509080300952532","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"tsqtsq","version":"1.0.1","keywords":["prometheus","promql","typescript","query","javascript"],"author":{"name":"Grafana Labs"},"license":"AGPL-3.0-only","_id":"tsqtsq@1.0.1","maintainers":[{"name":"jewbetcha","email":"crollins199@gmail.com"}],"homepage":"https://github.com/grafana/tsqtsq#readme","bugs":{"url":"https://github.com/grafana/tsqtsq/issues"},"dist":{"shasum":"e6cb7a70bdd8fa200904622b04e2ead5659960e2","tarball":"https://registry.npmjs.org/tsqtsq/-/tsqtsq-1.0.1.tgz","fileCount":21,"integrity":"sha512-ED+Fdi+htCGTb4KivIdwGFyYHjW3XNAmtbhev0Q4iB3z1XWhn0NPTe0/8L57AMyxqtTiTJBF1frPhodea+Dd7Q==","signatures":[{"sig":"MEUCIQC+2ncWMvHdnD6p6Re/zso2iBGDnK/+LKc+jHn4A2nICAIgFoRGfQ56kbzBtpKzuk3F6xZBySDgdXcgkr4hBCsbwQs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":79745},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"d92f0f49635fb928afe522494a1383d3b2ed8db0","scripts":{"test":"jest","build":"esbuild src/index.js --bundle --platform=node --outfile=dist/index.js ","test:watch":"jest --watch"},"_npmUser":{"name":"jewbetcha","email":"crollins199@gmail.com"},"repository":{"url":"git+https://github.com/grafana/tsqtsq.git","type":"git"},"_npmVersion":"10.5.0","description":"A reusable and composable query library for Prometheus","directories":{},"_nodeVersion":"18.20.2","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","esbuild":"^0.23.0","ts-jest":"^29.2.4","typescript":"^5.5.4","@types/jest":"^29.5.12"},"_npmOperationalInternal":{"tmp":"tmp/tsqtsq_1.0.1_1732560727476_0.41310043825042553","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"tsqtsq","version":"1.0.2","keywords":["prometheus","promql","typescript","query","javascript"],"author":{"name":"Grafana Labs"},"license":"AGPL-3.0-only","_id":"tsqtsq@1.0.2","maintainers":[{"name":"jewbetcha","email":"crollins199@gmail.com"}],"homepage":"https://github.com/grafana/tsqtsq#readme","bugs":{"url":"https://github.com/grafana/tsqtsq/issues"},"dist":{"shasum":"e3eb0d6813e04b00431ed880b6bc29c9b0c99432","tarball":"https://registry.npmjs.org/tsqtsq/-/tsqtsq-1.0.2.tgz","fileCount":23,"integrity":"sha512-9+jnIcHT0Ml+xk2T8MdJvztH4LhmjDhFI2jFwte67UgYropR2DVYttRHJye1MNzx/FnyIeOiJq4A84RobBZjTg==","signatures":[{"sig":"MEUCIHy24V5Rpm4dIujDV9TN4SmQxvpcZLKbZzIAH2+PWo46AiEAvHcDKi1ZgKF3KZJl4vBgSBd4CKMDVqevfFv81KWAy2A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":99129},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"35348c778255b2cb421c18d69a2f4f9795615629","scripts":{"test":"jest","build":"tsc","publish":"npm run build && npm run publish","test:watch":"jest --watch"},"_npmUser":{"name":"jewbetcha","email":"crollins199@gmail.com"},"repository":{"url":"git+https://github.com/grafana/tsqtsq.git","type":"git"},"_npmVersion":"10.5.0","description":"A reusable and composable query library for Prometheus","directories":{},"_nodeVersion":"18.20.2","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","esbuild":"^0.23.0","ts-jest":"^29.2.4","typescript":"^5.7.2","@types/jest":"^29.5.12"},"_npmOperationalInternal":{"tmp":"tmp/tsqtsq_1.0.2_1734114419219_0.0926432210057675","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"tsqtsq","version":"1.0.3","keywords":["prometheus","promql","typescript","query","javascript"],"author":{"name":"Grafana Labs"},"license":"AGPL-3.0-only","_id":"tsqtsq@1.0.3","maintainers":[{"name":"jewbetcha","email":"crollins199@gmail.com"}],"homepage":"https://github.com/grafana/tsqtsq#readme","bugs":{"url":"https://github.com/grafana/tsqtsq/issues"},"dist":{"shasum":"b6aae38863aa5ea362515518572a4087a575a6a1","tarball":"https://registry.npmjs.org/tsqtsq/-/tsqtsq-1.0.3.tgz","fileCount":50,"integrity":"sha512-92V9SHS01sx9a5dleJ65hmDPzW1O5IdzGZBjAyWdr62vw7Sz18qHBEaRmNTVmkzjyoRKvdSFQC1MjqtpdlXOuA==","signatures":[{"sig":"MEUCIB134KbfWFkUeqxWo/NWWCjEg6MrgDSuPW8UMYS1azXAAiEAvWmiHxXJbQPnnrBF+REQKVQQDqdwMa/DcLX8ZLu1I4I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":99505},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"6ce2aee1fffda21135f3b601b3d845e9c5f35a06","scripts":{"test":"jest","build":"tsc","publish":"npm run build && npm publish","test:watch":"jest --watch"},"_npmUser":{"name":"jewbetcha","email":"crollins199@gmail.com"},"repository":{"url":"git+https://github.com/grafana/tsqtsq.git","type":"git"},"_npmVersion":"10.5.0","description":"A reusable and composable query library for Prometheus","directories":{},"_nodeVersion":"18.20.2","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","esbuild":"^0.23.0","ts-jest":"^29.2.4","typescript":"^5.7.2","@types/jest":"^29.5.12"},"_npmOperationalInternal":{"tmp":"tmp/tsqtsq_1.0.3_1734115145230_0.5469083110161217","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"tsqtsq","version":"1.0.4","keywords":["prometheus","promql","typescript","query","javascript"],"author":{"name":"Grafana Labs"},"license":"AGPL-3.0-only","_id":"tsqtsq@1.0.4","maintainers":[{"name":"jewbetcha","email":"crollins199@gmail.com"}],"homepage":"https://github.com/grafana/tsqtsq#readme","bugs":{"url":"https://github.com/grafana/tsqtsq/issues"},"dist":{"shasum":"043e7a7345bff5cda2689460b4e01bdf3b579517","tarball":"https://registry.npmjs.org/tsqtsq/-/tsqtsq-1.0.4.tgz","fileCount":23,"integrity":"sha512-jr7AYv/0GogpIikPdUMPaT9XJLB86m8DLheWxmJJrgPy0tKP2SZswxVJWw6Uw1/dhiXIU5M1NJxIVgim0LiaRA==","signatures":[{"sig":"MEQCIF/GWuMEyfipeZvGeGzatx3V3GA+OGl4CMKXLo1/MN0eAiA8jXEMLqX+OTiBFYlMEkgVxIoUJsGS5ynd5Q4ZYr96Rw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84681},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"baf06ccff4327f714649e8dba20fc8538a62914c","scripts":{"test":"jest","build":"tsc","deploy":"npm run build && npm publish","test:watch":"jest --watch"},"_npmUser":{"name":"jewbetcha","email":"crollins199@gmail.com"},"repository":{"url":"git+https://github.com/grafana/tsqtsq.git","type":"git"},"_npmVersion":"10.5.0","description":"A reusable and composable query library for Prometheus","directories":{},"_nodeVersion":"18.20.2","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","esbuild":"^0.23.0","ts-jest":"^29.2.4","typescript":"^5.7.2","@types/jest":"^29.5.12"},"_npmOperationalInternal":{"tmp":"tmp/tsqtsq_1.0.4_1734115779644_0.11340108168588148","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"tsqtsq","version":"1.0.5","keywords":["prometheus","promql","typescript","query","javascript"],"author":{"name":"Grafana Labs"},"license":"AGPL-3.0-only","_id":"tsqtsq@1.0.5","maintainers":[{"name":"skl_","email":"info@skl.me"},{"name":"jewbetcha","email":"crollins199@gmail.com"}],"homepage":"https://github.com/grafana/tsqtsq#readme","bugs":{"url":"https://github.com/grafana/tsqtsq/issues"},"dist":{"shasum":"d7525b058bd45786c6a35ab3d496bda2493c1875","tarball":"https://registry.npmjs.org/tsqtsq/-/tsqtsq-1.0.5.tgz","fileCount":23,"integrity":"sha512-/9bb2Yp+BwbWmkQld5Fhv5kil4fcSPBoeZKDy67h7wZIU8YiFK3j/22PNw4X4QqPw7mGnczpUYKJB+MBAc5G7Q==","signatures":[{"sig":"MEQCIG7/hGEt0RRFKyd8A3k968XqqKmUW6p7NPpsbZinPauVAiBYW8eSsdW+94PGqaqinTvwtJktEVJ+5SyOk8U3Ei4PAg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85140},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.js","gitHead":"cb1cb17edd6f93bbd5ab875c61b59aae23520e08","scripts":{"test":"jest","build":"tsc","deploy":"npm run build && npm publish","test:watch":"jest --watch"},"_npmUser":{"name":"skl_","email":"info@skl.me"},"repository":{"url":"git+https://github.com/grafana/tsqtsq.git","type":"git"},"_npmVersion":"10.5.0","description":"A reusable and composable query library for Prometheus","directories":{},"_nodeVersion":"20.12.0","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","esbuild":"^0.23.0","ts-jest":"^29.2.4","typescript":"^5.7.2","@types/jest":"^29.5.12"},"_npmOperationalInternal":{"tmp":"tmp/tsqtsq_1.0.5_1734361214158_0.9770298932617514","host":"s3://npm-registry-packages-npm-production"}},"1.0.6":{"name":"tsqtsq","version":"1.0.6","keywords":["prometheus","promql","typescript","query","javascript"],"author":{"name":"Grafana Labs"},"license":"AGPL-3.0-only","_id":"tsqtsq@1.0.6","maintainers":[{"name":"skl_","email":"info@skl.me"},{"name":"jewbetcha","email":"crollins199@gmail.com"}],"homepage":"https://github.com/grafana/tsqtsq#readme","bugs":{"url":"https://github.com/grafana/tsqtsq/issues"},"dist":{"shasum":"1abb06896e061ea9c9f89db205cca522f0b88c1a","tarball":"https://registry.npmjs.org/tsqtsq/-/tsqtsq-1.0.6.tgz","fileCount":18,"integrity":"sha512-TWtWC7Apyeu6KmQPvxICnwKURzYIRX/2wh9m7/xdvhBnqxhgFFJb3qPmX6iMR3ymk7lTaiHkiysgtj4Vhwl0SA==","signatures":[{"sig":"MEUCIQDfE/KtzDPInueDujwLXWqw6bY/CkkTjvew8zRhe1R4KAIgd63LbqWkAzbpwCq5jFG2oImWOBgCcvEshx6bmPMQpw0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":51500},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"fa397e51320794f3415be8d1bf7610c987b0669d","scripts":{"test":"jest","build":"tsc","deploy":"npm run build && npm publish","test:watch":"jest --watch"},"_npmUser":{"name":"jewbetcha","email":"crollins199@gmail.com"},"repository":{"url":"git+https://github.com/grafana/tsqtsq.git","type":"git"},"_npmVersion":"10.5.0","description":"A reusable and composable query library for Prometheus","directories":{},"_nodeVersion":"18.20.2","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","esbuild":"^0.23.0","ts-jest":"^29.2.4","typescript":"^5.7.2","@types/jest":"^29.5.12"},"_npmOperationalInternal":{"tmp":"tmp/tsqtsq_1.0.6_1734363757792_0.9215246642801895","host":"s3://npm-registry-packages-npm-production"}},"1.0.7":{"name":"tsqtsq","version":"1.0.7","keywords":["prometheus","promql","typescript","query","javascript"],"author":{"name":"Grafana Labs"},"license":"AGPL-3.0-only","_id":"tsqtsq@1.0.7","maintainers":[{"name":"skl_","email":"info@skl.me"},{"name":"jewbetcha","email":"crollins199@gmail.com"}],"homepage":"https://github.com/grafana/tsqtsq#readme","bugs":{"url":"https://github.com/grafana/tsqtsq/issues"},"dist":{"shasum":"2adea156edb899f52473e46c2e074602439f4558","tarball":"https://registry.npmjs.org/tsqtsq/-/tsqtsq-1.0.7.tgz","fileCount":19,"integrity":"sha512-JxjeTCZXeCUlEGmSdFLNjqz8z/H8aqyQyPlfhmuvYCF5YDa457J+V49q4INRIcbswIm5UA+FSx3tzQdueE80hg==","signatures":[{"sig":"MEUCIBjwnBZmZ1tyfm5G+HzFju3YGUzvLIkRURrVseuV9u7RAiEAic/vBXBHQ5euh/zTBbnRmsLacp19KYElglj1kc8EZWA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":51860},"main":"dist/index.js","types":"dist/index.d.ts","exports":{"main":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"promql":{"types":"./dist/promql.d.ts","default":"./dist/promql.js"},"expression":{"types":"./dist/expression.d.ts","default":"./dist/expression.js"}},"gitHead":"45d7aefabd0a8ecb21a92f179a46f6209b96b895","scripts":{"test":"jest","build":"tsc","deploy":"npm run build && npm publish","test:watch":"jest --watch"},"_npmUser":{"name":"jewbetcha","email":"crollins199@gmail.com"},"repository":{"url":"git+https://github.com/grafana/tsqtsq.git","type":"git"},"_npmVersion":"10.5.0","description":"A reusable and composable query library for Prometheus","directories":{},"_nodeVersion":"18.20.2","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","esbuild":"^0.23.0","ts-jest":"^29.2.4","typescript":"^5.7.2","@types/jest":"^29.5.12"},"_npmOperationalInternal":{"tmp":"tmp/tsqtsq_1.0.7_1734377007597_0.9056723556326811","host":"s3://npm-registry-packages-npm-production"}},"1.0.8":{"name":"tsqtsq","version":"1.0.8","keywords":["prometheus","promql","typescript","query","javascript"],"author":{"name":"Grafana Labs"},"license":"AGPL-3.0-only","_id":"tsqtsq@1.0.8","maintainers":[{"name":"skl_","email":"info@skl.me"},{"name":"jewbetcha","email":"crollins199@gmail.com"}],"homepage":"https://github.com/grafana/tsqtsq#readme","bugs":{"url":"https://github.com/grafana/tsqtsq/issues"},"dist":{"shasum":"d041be6e08c4e74f272ec24cad941807559a54c9","tarball":"https://registry.npmjs.org/tsqtsq/-/tsqtsq-1.0.8.tgz","fileCount":19,"integrity":"sha512-8EP8nEuKSx2AOVk5xxxEdNZjbHcE+KpkjqjK4PwXtZYh1sJG6Q9BSMfkKB3eRPDR4a2XsQx91rWNLQzH2rmOhg==","signatures":[{"sig":"MEUCICmfg+GgVeIGQKD4Obs8JcTdiVIpwp5kQonA3JULz7gAAiEA8ifpzn6ql81UwBAfRIYyWCsFTegZlxizTCwe8QH1JLQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":52173},"main":"dist/index.js","types":"dist/index.d.ts","exports":{"main":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"promql":{"types":"./dist/promql.d.ts","default":"./dist/promql.js"},"expression":{"types":"./dist/expression.d.ts","default":"./dist/expression.js"}},"gitHead":"91a88d455f4bf3b69ed9f0598e7f7a469fa0901c","scripts":{"test":"jest","build":"tsc","deploy":"npm run build && npm publish","test:watch":"jest --watch"},"_npmUser":{"name":"jewbetcha","email":"crollins199@gmail.com"},"repository":{"url":"git+https://github.com/grafana/tsqtsq.git","type":"git"},"_npmVersion":"10.5.0","description":"A reusable and composable query library for Prometheus","directories":{},"_nodeVersion":"18.20.2","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","esbuild":"^0.23.0","ts-jest":"^29.2.4","typescript":"^5.7.2","@types/jest":"^29.5.12"},"_npmOperationalInternal":{"tmp":"tmp/tsqtsq_1.0.8_1734377355939_0.5016718170817032","host":"s3://npm-registry-packages-npm-production"}},"1.0.9":{"name":"tsqtsq","version":"1.0.9","keywords":["prometheus","promql","typescript","query","javascript"],"author":{"name":"Grafana Labs"},"license":"AGPL-3.0-only","_id":"tsqtsq@1.0.9","maintainers":[{"name":"skl_","email":"info@skl.me"},{"name":"jewbetcha","email":"crollins199@gmail.com"}],"homepage":"https://github.com/grafana/tsqtsq#readme","bugs":{"url":"https://github.com/grafana/tsqtsq/issues"},"dist":{"shasum":"85249e39ddc4e67329885b6e6e5fbf4621daff98","tarball":"https://registry.npmjs.org/tsqtsq/-/tsqtsq-1.0.9.tgz","fileCount":19,"integrity":"sha512-S37aVmX6dBgsnJ7K3MqLfV7z7hAE96lCGmedZbcynjnhG2ovsjy2pzkqX/lEtGcBVpocaRtfUbjkRxoXIKOYTg==","signatures":[{"sig":"MEUCIQDZIrQXc61MT05W96sMfVHSV9gtYcC8hH5tIEAaAsy7ygIgTNXK/AcitvRmj2ZJO5zTWUIq34GuttpmyIukUBd0n+w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":51890},"main":"dist/index.js","types":"dist/index.d.ts","exports":"./dist/index.js","gitHead":"2c1c2688b673e4360e71eb5edd3d2bf48ae77548","scripts":{"test":"jest","build":"tsc","deploy":"npm run build && npm publish","test:watch":"jest --watch"},"_npmUser":{"name":"jewbetcha","email":"crollins199@gmail.com"},"repository":{"url":"git+https://github.com/grafana/tsqtsq.git","type":"git"},"_npmVersion":"10.5.0","description":"A reusable and composable query library for Prometheus","directories":{},"_nodeVersion":"18.20.2","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","esbuild":"^0.23.0","ts-jest":"^29.2.4","typescript":"^5.7.2","@types/jest":"^29.5.12"},"_npmOperationalInternal":{"tmp":"tmp/tsqtsq_1.0.9_1734379885238_0.0037833024205500276","host":"s3://npm-registry-packages-npm-production"}},"1.0.10":{"name":"tsqtsq","version":"1.0.10","keywords":["prometheus","promql","typescript","query","javascript"],"author":{"name":"Grafana Labs"},"license":"AGPL-3.0-only","_id":"tsqtsq@1.0.10","maintainers":[{"name":"skl_","email":"info@skl.me"},{"name":"jewbetcha","email":"crollins199@gmail.com"}],"homepage":"https://github.com/grafana/tsqtsq#readme","bugs":{"url":"https://github.com/grafana/tsqtsq/issues"},"dist":{"shasum":"a59d26b4a5cd027a2ccad0070ab3ad7bdaddb24f","tarball":"https://registry.npmjs.org/tsqtsq/-/tsqtsq-1.0.10.tgz","fileCount":19,"integrity":"sha512-G1aZTcTPqUuNX3O8FOgf/WY6kSDpKxwtz7UBk7mPpu171jcGUGxuV2vrigHmN9N/fN2lYgswSW3vNbKe8p1ATA==","signatures":[{"sig":"MEQCIHB6MIgVRaEQLfFPOf/YjNEqnJWB3V41WZCqeMMdzF69AiABXaSrtq3VrrGjRen6Vi4C1fcUCnM5pnlLVyY5o3zDoQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":52224},"main":"dist/index.js","types":"dist/index.d.ts","exports":"./dist/index.js","gitHead":"2c27b59a3932c68459c7be3aba3ef0f0ad5fa27b","scripts":{"test":"jest","build":"tsc","deploy":"npm run build && npm publish","test:watch":"jest --watch"},"_npmUser":{"name":"jewbetcha","email":"crollins199@gmail.com"},"repository":{"url":"git+https://github.com/grafana/tsqtsq.git","type":"git"},"_npmVersion":"10.5.0","description":"A reusable and composable query library for Prometheus","directories":{},"_nodeVersion":"18.20.2","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","esbuild":"^0.23.0","ts-jest":"^29.2.4","typescript":"^5.7.2","@types/jest":"^29.5.12"},"_npmOperationalInternal":{"tmp":"tmp/tsqtsq_1.0.10_1734540304349_0.9711027944803245","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"tsqtsq","version":"1.1.0","keywords":["prometheus","promql","typescript","query","javascript"],"author":{"name":"Grafana Labs"},"license":"AGPL-3.0-only","_id":"tsqtsq@1.1.0","maintainers":[{"name":"skl_","email":"info@skl.me"},{"name":"jewbetcha","email":"crollins199@gmail.com"}],"homepage":"https://github.com/grafana/tsqtsq#readme","bugs":{"url":"https://github.com/grafana/tsqtsq/issues"},"dist":{"shasum":"1eb269a441021f25d29dd805788ddbe282e41c38","tarball":"https://registry.npmjs.org/tsqtsq/-/tsqtsq-1.1.0.tgz","fileCount":19,"integrity":"sha512-gwcCIRNbiFJCNZ32frZ3Uqe4CnzZSXHrhUqWhTy9IjoXDodZYuMcvDT5z2Tf0cMj6vcgC62jf4aRoWIlLafVMg==","signatures":[{"sig":"MEUCIQDFWKs3puXvQiQO0AenLhswn8o9OX7rdyButMiBmj61zgIgXUfWzAPrlGnLpFP8kEHUMt9uIxWezOXpzpC7CRwda1A=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":52413},"main":"dist/index.js","types":"dist/index.d.ts","exports":"./dist/index.js","gitHead":"bfc1e2ba49676f46b98bf5a396752d427af6a355","scripts":{"test":"jest","build":"tsc","deploy":"npm run build && npm publish","test:watch":"jest --watch"},"_npmUser":{"name":"jewbetcha","actor":{"name":"jewbetcha","type":"user","email":"crollins199@gmail.com"},"email":"crollins199@gmail.com"},"repository":{"url":"git+https://github.com/grafana/tsqtsq.git","type":"git"},"_npmVersion":"10.5.0","description":"A reusable and composable query library for Prometheus","directories":{},"_nodeVersion":"18.20.2","_hasShrinkwrap":false,"devDependencies":{"jest":"^30.0.0","esbuild":"^0.25.3","ts-jest":"^29.2.4","typescript":"^5.7.2","@types/jest":"^30.0.0"},"_npmOperationalInternal":{"tmp":"tmp/tsqtsq_1.1.0_1750268711780_0.051509236031467065","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"tsqtsq","version":"1.2.0","keywords":["prometheus","promql","typescript","query","javascript"],"author":{"name":"Grafana Labs"},"license":"AGPL-3.0-only","_id":"tsqtsq@1.2.0","maintainers":[{"name":"skl_","email":"info@skl.me"},{"name":"jewbetcha","email":"crollins199@gmail.com"}],"homepage":"https://github.com/grafana/tsqtsq#readme","bugs":{"url":"https://github.com/grafana/tsqtsq/issues"},"dist":{"shasum":"f1faa76300e1e7e867de698a7649560b5de1f95e","tarball":"https://registry.npmjs.org/tsqtsq/-/tsqtsq-1.2.0.tgz","fileCount":19,"integrity":"sha512-Csacuo9+grsX79QlUr1MBgraS6mB+ZQXLQ7WcH6iVnrqsblGK623jPUnMtZm+nj6imL2q6xNB/mNJGmvaILl5w==","signatures":[{"sig":"MEUCIFBbHMS/9U8eUteHXWK942rBaWqX9rswGmAushnmjwi+AiEA24F6Wr6Pl3hs+XKYmBy401oPxaJFmldAQHz6CXUHVPA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":58224},"main":"dist/index.js","types":"dist/index.d.ts","exports":"./dist/index.js","gitHead":"df6fcfc012c25255f3eb5f1400c76460ee984dd0","scripts":{"docs":"rm -rf docs && typedoc","test":"jest","build":"tsc","deploy":"npm run build && npm publish","test:watch":"jest --watch"},"_npmUser":{"name":"jewbetcha","email":"crollins199@gmail.com"},"repository":{"url":"git+https://github.com/grafana/tsqtsq.git","type":"git"},"_npmVersion":"10.9.2","description":"A reusable and composable query library for Prometheus","directories":{},"_nodeVersion":"22.16.0","_hasShrinkwrap":false,"devDependencies":{"jest":"30.2.0","esbuild":"0.27.3","ts-jest":"29.4.6","typedoc":"^0.28.17","typescript":"5.9.3","@types/jest":"30.0.0"},"_npmOperationalInternal":{"tmp":"tmp/tsqtsq_1.2.0_1772220249210_0.19963874672565285","host":"s3://npm-registry-packages-npm-production"}},"1.2.1":{"name":"tsqtsq","version":"1.2.1","keywords":["prometheus","promql","typescript","query","javascript"],"author":{"name":"Grafana Labs"},"license":"AGPL-3.0-only","_id":"tsqtsq@1.2.1","maintainers":[{"name":"skl_","email":"info@skl.me"},{"name":"jewbetcha","email":"crollins199@gmail.com"}],"homepage":"https://github.com/grafana/tsqtsq#readme","bugs":{"url":"https://github.com/grafana/tsqtsq/issues"},"dist":{"shasum":"28c168e0ec669f5ac6980209c33f8edcf83ee9a2","tarball":"https://registry.npmjs.org/tsqtsq/-/tsqtsq-1.2.1.tgz","fileCount":19,"integrity":"sha512-wFssldDpPj5XR2O4pw3WBOgcPwj66XUwOsZsaV5M15NIHOyjmf+MVhbWMKUd5iJt5p+xOHcCvxh6vBSpXAclyg==","signatures":[{"sig":"MEQCIBgJlNsZ95y2QADUeun8oucf0zmwCEBDrVZ2x59IUXsCAiAsCim6HtIpS71RH2Kn3UB0OaVsMUGPx5UPb/sBMfKg6w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":58229},"main":"dist/index.js","types":"dist/index.d.ts","exports":"./dist/index.js","gitHead":"f7fe46a74eaf38588a464e03afae925ae123a6cf","scripts":{"docs":"rm -rf docs && typedoc","test":"jest","build":"tsc","deploy":"npm run build && npm publish","test:watch":"jest --watch"},"_npmUser":{"name":"skl_","email":"info@skl.me"},"repository":{"url":"git+https://github.com/grafana/tsqtsq.git","type":"git"},"_npmVersion":"10.9.4","description":"A reusable and composable query library for Prometheus","directories":{},"_nodeVersion":"22.22.0","_hasShrinkwrap":false,"devDependencies":{"jest":"30.3.0","esbuild":"0.28.0","ts-jest":"29.4.9","typedoc":"0.28.19","typescript":"6.0.3","@types/jest":"30.0.0"},"_npmOperationalInternal":{"tmp":"tmp/tsqtsq_1.2.1_1777312850849_0.3048516969711774","host":"s3://npm-registry-packages-npm-production"}},"1.3.0":{"name":"tsqtsq","version":"1.3.0","keywords":["prometheus","promql","typescript","query","javascript"],"author":{"name":"Grafana Labs"},"license":"AGPL-3.0-only","_id":"tsqtsq@1.3.0","maintainers":[{"name":"skl_","email":"info@skl.me"},{"name":"jewbetcha","email":"crollins199@gmail.com"}],"homepage":"https://github.com/grafana/tsqtsq#readme","bugs":{"url":"https://github.com/grafana/tsqtsq/issues"},"dist":{"shasum":"02f92eb77d6f376a7dd4ddf7f82ef7ab464f7387","tarball":"https://registry.npmjs.org/tsqtsq/-/tsqtsq-1.3.0.tgz","fileCount":19,"integrity":"sha512-JIoLNLK7tjWmq5iGrvX2+Bd6tntKRkswez1xmB/Ni0Q6Rdn4ICA0kP+S42WyvAPtMWg197097vGuLVJkzxDhSg==","signatures":[{"sig":"MEUCIBKv9NTD087LNDhhWzh59sMnDJ0VCQegrighJ4zZjPdnAiEA5RKggs3t7iXNGyHbRirFu5+v6RWglBV5no8KeAgcKrc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":58729},"main":"dist/index.js","types":"dist/index.d.ts","exports":"./dist/index.js","gitHead":"e786e57173ca94fbfc75fd6b9c0397dfa330cf95","scripts":{"docs":"rm -rf docs && typedoc","test":"jest","build":"tsc","deploy":"npm run build && npm publish","test:watch":"jest --watch"},"_npmUser":{"name":"skl_","email":"info@skl.me"},"devEngines":{"runtime":{"name":"node","onFail":"error"},"packageManager":{"name":"npm","onFail":"error"}},"repository":{"url":"git+https://github.com/grafana/tsqtsq.git","type":"git"},"_npmVersion":"11.14.1","description":"A reusable and composable query library for Prometheus","directories":{},"_nodeVersion":"22.22.0","_hasShrinkwrap":false,"devDependencies":{"jest":"30.4.1","esbuild":"0.28.0","ts-jest":"29.4.9","typedoc":"0.28.19","typescript":"6.0.3","@types/jest":"30.0.0"},"_npmOperationalInternal":{"tmp":"tmp/tsqtsq_1.3.0_1778799781425_0.3385729977819756","host":"s3://npm-registry-packages-npm-production"}},"1.4.0":{"name":"tsqtsq","version":"1.4.0","keywords":["prometheus","promql","typescript","query","javascript"],"author":"Grafana Labs","license":"AGPL-3.0-only","_id":"tsqtsq@1.4.0","maintainers":[{"name":"skl_","email":"info@skl.me"},{"name":"jewbetcha","email":"crollins199@gmail.com"}],"dist":{"shasum":"910f333f40226479ebc607b48a839fc2720e2723","tarball":"https://registry.npmjs.org/tsqtsq/-/tsqtsq-1.4.0.tgz","fileCount":19,"integrity":"sha512-/E7nP/42L46PokUiaazpIWhq7NzAbBSYgrcotKkqRSgknWr2B+ufcs2Eb5fmATkaryYedVDmWUczWPVFWJnnkw==","signatures":[{"sig":"MEQCIG2vsGGKdAjZzNri+rIosXMhOckjULbiTnjjkSFCuZOqAiBLNDp/xVTDk8aRfPhvk7OnHoaacn+zfiQLUslvE3Jbww==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":59724},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=24"},"exports":"./dist/index.js","scripts":{"docs":"rm -rf docs && typedoc","test":"jest","build":"tsc","deploy":"pnpm run build && pnpm publish","test:watch":"jest --watch"},"_npmUser":{"name":"skl_","email":"info@skl.me"},"repository":{"url":"git+https://github.com/grafana/tsqtsq.git","type":"git"},"description":"A reusable and composable query library for Prometheus","directories":{},"_nodeVersion":"24.16.0","_hasShrinkwrap":false,"devDependencies":{"jest":"30.4.2","esbuild":"0.28.1","ts-jest":"29.4.11","typedoc":"0.28.19","typescript":"6.0.3","@types/jest":"30.0.0"},"_npmOperationalInternal":{"tmp":"tmp/tsqtsq_1.4.0_1783201478150_0.8937806895444202","host":"s3://npm-registry-packages-npm-production"}},"1.5.0":{"name":"tsqtsq","version":"1.5.0","keywords":["prometheus","promql","typescript","query","javascript"],"author":"Grafana Labs","license":"Apache-2.0","_id":"tsqtsq@1.5.0","maintainers":[{"name":"skl_","email":"info@skl.me"},{"name":"jewbetcha","email":"crollins199@gmail.com"}],"dist":{"shasum":"fc2e226c1151eef2d5e938fb8d451010ee21b747","tarball":"https://registry.npmjs.org/tsqtsq/-/tsqtsq-1.5.0.tgz","fileCount":22,"integrity":"sha512-JdQnMJV8Zuv0NZXocY/zwHYPri6DOco633qCc5LHVhE0zun1Nnp2BMmKRyXwSarIzby6fkfzccuH9QPWJ0NkPQ==","signatures":[{"sig":"MEUCIECaIevGPa/6wIY4ORJEUG4c8awuroHBGByx5srEONlHAiEArQ5wtYnVgMl7aflYZMSXpJuMQkBdMD0cTJF6Lr8ZUf0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQDdGWNlULihaXJ+VF8l5r2EiCB12ZviB4tuKpfQeiv7gAIhAOFUhaKfl1Jq7QPzA+j1jf54Q9khib61O/e901zqqtpb","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":51695},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=24"},"exports":"./dist/index.js","scripts":{"docs":"rm -rf docs && typedoc","test":"jest","build":"tsc","deploy":"pnpm run build && pnpm publish","test:watch":"jest --watch","generate:fixtures":"node scripts/generate-fixtures.mjs"},"_npmUser":{"name":"skl_","email":"info@skl.me"},"repository":{"url":"git+https://github.com/grafana/tsqtsq.git","type":"git"},"description":"A reusable and composable query library for Prometheus","directories":{},"dependencies":{"@lezer/lr":"1.4.10","@prometheus-io/lezer-promql":"0.314.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"30.4.2","esbuild":"0.28.2","ts-jest":"29.4.12","typedoc":"0.28.20","typescript":"npm:@typescript/typescript6@6.0.2","@types/jest":"30.0.0","@typescript/native":"npm:typescript@7.0.2"},"_npmOperationalInternal":{"tmp":"tmp/tsqtsq_1.5.0_1789131353005_0.8297817957727454","host":"s3://npm-registry-packages-npm-production"}},"1.5.1":{"_id":"tsqtsq@1.5.1","dist":{"shasum":"dd47030bf3af9bdc4524e0342ab578392a75c435","tarball":"https://registry.npmjs.org/tsqtsq/-/tsqtsq-1.5.1.tgz","fileCount":22,"integrity":"sha512-R59eZGnfOj1kdiqOyWCQq1CaiI9uU7d1OivyUvSLSwT4v03ZSYFgGmbuT8Z3/m4Z9e10lHGuLbpxs0IHAO+jxA==","signatures":[{"sig":"MEQCIEHLS7zwgPraug3lNgdOS5LQP2V1R7Lj+4r+ZQAUO+IJAiBKI1suiQJNgMYgHM4W0rNeUZvUMH4FosfcukNLU/brhQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAKb9mWTzUfd1wY6L+JAlfBvLYrvBKMcpMwkBJiCc+UNAiAqg8tKVqZpAzdskGcd791aMP4FHpi1kaicXJCgojJ44g=="}],"unpackedSize":54916},"main":"dist/index.js","name":"tsqtsq","types":"dist/index.d.ts","author":"Grafana Labs","engines":{"node":">=24"},"exports":"./dist/index.js","license":"Apache-2.0","scripts":{"docs":"rm -rf docs && typedoc","test":"jest","build":"tsc","deploy":"pnpm run build && pnpm publish","test:watch":"jest --watch","generate:fixtures":"node scripts/generate-fixtures.mjs"},"version":"1.5.1","_npmUser":{"name":"skl_","email":"info@skl.me"},"keywords":["prometheus","promql","typescript","query","javascript"],"repository":{"url":"git+https://github.com/grafana/tsqtsq.git","type":"git"},"description":"A reusable and composable query library for Prometheus","directories":{},"maintainers":[{"name":"skl_","email":"info@skl.me"},{"name":"jewbetcha","email":"crollins199@gmail.com"}],"dependencies":{"@lezer/lr":"1.4.10","@prometheus-io/lezer-promql":"0.314.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"30.4.2","esbuild":"0.28.2","ts-jest":"29.4.12","typedoc":"0.28.20","typescript":"npm:@typescript/typescript6@6.0.2","@types/jest":"30.0.0","@typescript/native":"npm:typescript@7.0.2"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/tsqtsq_1.5.1_1789139507142_0.9367873833894695"}}},"time":{"created":"2024-11-25T18:37:07.755Z","modified":"2026-09-11T15:11:47.517Z","1.0.0":"2024-11-25T18:37:07.944Z","1.0.1":"2024-11-25T18:52:07.706Z","1.0.2":"2024-12-13T18:26:59.384Z","1.0.3":"2024-12-13T18:39:05.417Z","1.0.4":"2024-12-13T18:49:39.837Z","1.0.5":"2024-12-16T15:00:14.405Z","1.0.6":"2024-12-16T15:42:37.968Z","1.0.7":"2024-12-16T19:23:27.827Z","1.0.8":"2024-12-16T19:29:16.111Z","1.0.9":"2024-12-16T20:11:25.474Z","1.0.10":"2024-12-18T16:45:04.520Z","1.1.0":"2025-06-18T17:45:11.986Z","1.2.0":"2026-02-27T19:24:09.367Z","1.2.1":"2026-04-27T18:00:51.016Z","1.3.0":"2026-05-14T23:03:01.613Z","1.4.0":"2026-07-04T21:44:38.305Z","1.5.0":"2026-09-11T12:55:53.083Z","1.5.1":"2026-09-11T15:11:47.230Z"},"author":"Grafana Labs","license":"Apache-2.0","keywords":["prometheus","promql","typescript","query","javascript"],"repository":{"url":"git+https://github.com/grafana/tsqtsq.git","type":"git"},"description":"A reusable and composable query library for Prometheus","maintainers":[{"name":"skl_","email":"info@skl.me"},{"name":"jewbetcha","email":"crollins199@gmail.com"}],"readme":"# tsqtsq - A PromQL Query Library\n\n[**API Docs**](https://grafana.github.io/tsqtsq/)\n\n> Looking for Jsonnet? The same API is available as a Jsonnet library for\n> monitoring mixins: see [`jsonnet/`](https://github.com/grafana/tsqtsq/tree/main/jsonnet). It is kept behaviourally\n> identical to the TypeScript implementation by a conformance corpus generated\n> from this repo's test suite.\n\n`tsqtsq` aims to make hard-coded PromQL queries easier to read and maintain. Wide-ranging changes and common \"query snippets\" have varying approaches and often impact query readability. By introducing typed, templated queries, changing common expressions and debugging becomes much easier.\n\nConsider the following use cases:\n\n- Implement de-duplication of all existing queries\n- Establish patterns for writing new queries\n- Create reusable snippets that accept arguments for metric labels\n\nThe library in this directory is an effort to reduce the potential toil involved in refactoring tasks like those mentioned above.\n\n## Principles\n\n- Maintain \"backwards compatibilty\" by returning PromQL queries as a simple `string` - just like the string literals and template strings we used before.\n- Re-usability of \"query snippets\" is a priority.\n- Avoid verbose library usage and syntax wherever possible, prefer ease of use over type purity.\n- Aim to make metrics and labels \"discoverable\" through IntelliSense, to aid query writing in the editor.\n- Embed \"sensible defaults\" and tribal knowledge using query abstraction - e.g. using `container!=\"\"` as a default matcher for requests/limits but only if the `container` label is not passed a value (this avoids matching against the confusing pod-level cgroup metrics).\n- Prefer named object/property parameters over ordered/implicit arguments - because who can remember whether the labels or the query comes first.\n\n## Examples\n\n```ts\nimport { promql, Expression } from 'tsqtsq';\n```\n\n`sum`\n\n```ts\npromql.sum({ expr: 'test_metric{foo=\"bar\"}', by: ['foo', 'bar', 'baz'] });\n```\n\nbecomes\n\n```\nsum by (foo, bar, baz) (test_metric{foo=\"bar\"})\n```\n\n`rate`\n\n```ts\npromql.rate({ expr: 'test_metric{bar=\"baz\"}', interval: '5m' });\n```\n\nbecomes\n\n```\ntest_metric(foo{bar=\"baz\"}[5m])\n```\n\n`label manipulation`\n\n```ts\npromql.label_replace({ expr: 'test_metric{foo=\"bar\"}', newLabel: 'baz', existingLabel: 'foo' });\n```\n\nbecomes\n\n```\nlabel_replace(test_metric{foo=\"bar\"}, \"baz\", \"$1\", \"foo\", \"(.*)\")\n```\n\n`aggregation over time`\n\n```ts\npromql.sum_over_time({ expr: 'test_metric{foo=\"bar\"}' });\n```\n\nbecomes\n\n```\nsum_over_time((test_metric{foo=\"bar\"})[$__range:])\n```\n\n`simple offset`\n\n```ts\npromql.offset({ units: { d: 42 } });\n```\n\nbecomes\n\n```\noffset 42d\n```\n\n`complex offset`\n\n```ts\npromql.offset({ units: { y: 2, d: 1, h: 42, m: 2, s: 3 } });\n```\n\nbecomes\n\n```\noffset 2y1d42h2m3s\n```\n\n`arithmetic binary ops`\n\n```ts\npromql.div({ left: 'http_requests_total', right: 'http_requests_duration_seconds' });\n```\n\nbecomes\n\n```\n(http_requests_total / http_requests_duration_seconds)\n```\n\n`vector matching with on`\n\n```ts\npromql.div({\n  left: 'http_requests_total{job=\"api\"}',\n  right: 'http_requests_total{job=\"api\"}',\n  on: ['instance'],\n  groupLeft: [],\n});\n```\n\nbecomes\n\n```\n(http_requests_total{job=\"api\"} / on (instance) group_left() http_requests_total{job=\"api\"})\n```\n\n`composing with rate`\n\n```ts\npromql.div({\n  left: promql.rate({ expr: 'http_requests_total{code=\"200\"}' }),\n  right: promql.rate({ expr: 'http_requests_total' }),\n  on: ['instance'],\n  groupLeft: ['job'],\n});\n```\n\nbecomes\n\n```\n(rate(http_requests_total{code=\"200\"}[$__rate_interval]) / on (instance) group_left (job) rate(http_requests_total[$__rate_interval]))\n```\n\n### Pretty-printing expressions\n\nBy default all queries render on a single line. The `prettify` helper reformats an expression for readability, breaking parenthesized groups and binary operations that exceed the maximum line width (80 characters by default) onto indented lines:\n\n```ts\nimport { prettify, promql } from 'tsqtsq';\n\nprettify({\n  expr: promql.sum({\n    by: ['cluster', 'namespace', 'workload', 'workload_type', 'pod'],\n    expr: promql.max({\n      by: ['cluster', 'namespace', 'pod', 'interface'],\n      expr: promql.rate({ expr: 'container_network_transmit_packets_dropped_total{}' }),\n    }),\n  }),\n});\n```\n\nbecomes\n\n```\nsum by (cluster, namespace, workload, workload_type, pod) (\n  max by (cluster, namespace, pod, interface) (\n    rate(container_network_transmit_packets_dropped_total{}[$__rate_interval])\n  )\n)\n```\n\nExpressions that already fit on one line are returned unchanged. The indentation width and line width are configurable via `indent` and `maxWidth`:\n\n```ts\nprettify({ expr: myQuery, indent: 4, maxWidth: 120 });\n```\n\nExpressions are parsed with [`@prometheus-io/lezer-promql`](https://www.npmjs.com/package/@prometheus-io/lezer-promql). Grafana [template variables](https://grafana.com/docs/grafana/latest/visualizations/dashboards/variables/global-variables/) such as `$__rate_interval`, `$job` and `${cluster}` are supported even though they are not valid PromQL. `prettify` throws an `Error` if the expression cannot be parsed or if `indent`/`maxWidth` are invalid.\n\n### Using the `Expression` class\n\nThe `Expression` class can be used to compose reusable PromQL expressions to be further used with the `promql` library.\n\n```ts\nnew Expression({\n  metric: 'test_metric',\n  values: {\n    arg1: 'foo',\n    arg2: 'bar'\n  },\n  defaultOperator: MatchingOperator.regexMatch,\n  defaultSelectors: [{ label: 'baz', operator: MatchingOperator.notEqual, value: '' }],\n}).toString(),\n```\n\nbecomes\n\n```\ntest_metric{baz!=\"\", arg1=~\"foo\", arg2=~\"bar\"}\n```\n\nwhich can then be used with a `promql` method\n\n```ts\npromql.max({\n  by: 'baz',\n  expr: new Expression({\n    metric: 'test_metric',\n    values: {\n      arg1: 'foo',\n      arg2: 'bar',\n    },\n    defaultOperator: MatchingOperator.regexMatch,\n    defaultSelectors: [{ label: 'baz', operator: MatchingOperator.notEqual, value: '' }],\n  }).toString(),\n});\n```\n\nbecomes\n\n```\nmax by (baz) (test_metric{baz!=\"\", arg1=~\"foo\", arg2=~\"bar\"})\n```\n\nsee [promql.ts](./src/promql.ts) for all available methods.\n","readmeFilename":""}