npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tinoy/pi-tariff

v0.2.0

Published

The house price table's contract for pi extensions: the configured tariff file, its validation, and the refusal an unconfigured machine gets.

Readme

[!WARNING] Do not install anything here yet.

This is a fast-moving prototype: the interfaces change without notice, and nothing here is stable. Every package in this project is headed for a stable 1.0, but that is still some way off. Install one only if you intend to follow the code and expect breakage.

@tinoy/pi-tariff

The house price table's contract: one owner for the configured tariff file, its validation and its refusal. Two consumers read it — the cost footer and the fleet's retirement economics — and a second copy of the numbers anywhere would let one of them decide against last month's table while the other reported this month's. This package is a library: it registers nothing with pi, and its pi.extensions list is empty so that installing it cannot load anything. It is meant to arrive as a dependency:

{ "dependencies": { "@tinoy/pi-tariff": "^0.1.0" } }

Installing it into pi directly (pi install npm:@tinoy/pi-tariff) is harmless and does nothing on its own: with no configured table it refuses, and no consumer is present to price from it.

No rate ships in this package

The table is DATA. This package carries EXAMPLE_TARIFF — a synthetic 1 : 10 : 100 ladder that is no vendor's tariff — so the file's shape is documented in code and the refusal can print the exact shape it wants. Nothing prices from the example: a rate that is not the one this machine is billed at is worse than no figure at all.

The live table is read from PI_TARIFF_CONFIG when set, else <agent dir>/tariff.json ($PI_CODING_AGENT_DIR, default ~/.pi/agent). It is never part of this package and never in the tarball.

What an unconfigured machine gets

A refusal, never a price. loadTariff().ok is false and its reason names the file to write and the shape to write it in, with the example table inlined. Each consumer decides how that surfaces: the cost footer registers no pricing and stays empty, while the fleet's retirement check returns its own typed refusal naming the same file.

The file is read once per process, by the first loadTariff() call, so an edit applies to the next session, not the running one. Importing the module does no I/O: a consumer that never prices never touches the file.

API

| Export | Purpose | | --- | --- | | loadTariff() | { ok: true, table, path } or { ok: false, reason, path }; reads the file on the first call and memoizes the result | | liveTariff() | the configured table, or a throw carrying the refusal reason — the one gate a pricer goes through | | TARIFF_CONFIG_PATH | where the table was read from | | EXAMPLE_TARIFF | the synthetic shape documentation; never a price | | ratios(table, column?, window?) | the cache-read ratios derived from a given table, not from literals | | WINDOWS, HOUSE_TARIFF_MODELS | ["valley", "peak"], and the model ids billed at this tariff | | TariffConfig, TariffTable, TariffRow, TariffLoad, Window, Ratios | the types |

Works better with

| Neighbour | You gain | You lose without it | Install | | --- | --- | --- | --- | | tariff.json | the rates this machine is billed at, so the footer and the retirement maths are about real money | every consumer refuses and prices nothing | not a package |

tariff.json is your own data, by design: this package ships the shape and the refusal, never the numbers. Point PI_TARIFF_CONFIG at it to keep it anywhere on the machine.

Dependencies

@tinoy/pi-ext-lib for the diagnostics line an unconfigured machine emits once per process. No pi package is imported, so this package declares no peer dependency.

Licence

MIT — see the repository LICENSE.