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

@metrologybench/core

v0.6.1

Published

Open-source metrology calculations with every equation, coefficient and source shown. Powers metrologybench.com, its embeddable calculators and the metrology-toolbox-mcp server.

Readme

@metrologybench/core

Open-source metrology calculations with every equation, coefficient and source shown. This library powers metrologybench.com, its embeddable calculators and its MCP server, so every surface gives the same answer.

Results are calculated values, not certified results. Accredited laboratories must validate any software they use for calibration results themselves (ISO/IEC 17025, clause 7.11). The test vectors in vectors/ are provided to help with that.

What's in v0.1.0

| Module | Functions | Source | |---|---|---| | RTD | rtdResistance, rtdTemperature, rtdSensitivity | Callendar–Van Dusen equation, Pt385 coefficients (IEC 60751 / ASTM E1137) | | Thermocouple | tcEmf, tcTemperature, tcRange (types B, E, J, K, N, R, S, T); cold-junction compensation tcTemperatureCjc, tcEmfCjc | NIST ITS-90 Thermocouple Database, SRD 60 (Monograph 175); same functions as IEC 60584-1:2013 | | Rounding | roundDecimals, roundSigFigs, formatValue | Decimal-string rounding, half up or half to even | | Conformity | conformity, specificRisk, guardBandForSpecificRisk, acceptanceLimits, globalRisk, managedGuardBand, globalRiskStatement | Decision rules and guard bands (ILAC G8:09/2019, ASME B89.7.3.1); specific and global risk with normal distributions (JCGM 106:2012, ANSI/NCSL Z540.3 Handbook) |

Rules every function follows

  • Full precision inside, rounding only for display. Use the rounding module to present a result; never round in the middle of a calculation.
  • Refuse, don't extrapolate. Inputs outside an equation's defined range throw OutOfRangeError with the valid range in the message.
  • Every thermocouple inverse reports its NIST error band alongside the temperature.
  • Cold-junction compensation adds EMFs, never temperatures: E_total = E_measured + E(t_ref), then invert.

Example

import { rtdResistance, tcTemperature, roundDecimals } from '@metrologybench/core';

roundDecimals(rtdResistance(100), 4);   // "138.5055"  (Pt100 at 100 °C)
tcTemperature('K', 4.096);              // { value: ≈100.0, inverseError: [-0.05, 0.04] }
tcTemperatureCjc('J', 4.095, 23);       // reference junction at 23 °C: value ≈ 100.0 °C

Test vectors

vectors/v0.1.0.json holds every reference case: inputs, expected value, tolerance, source and why the case matters. npm test checks the library against all of them, plus full-range round-trip sweeps.

License

Code: Apache 2.0. Written content on metrologybench.com: CC BY 4.0. "Metrology Bench" is a name, not part of the license.