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

@squawk/units

v0.4.8

Published

Aviation-aware unit conversion and formatting utilities

Readme

MIT License npm TypeScript

Aviation-aware unit conversion and formatting utilities. Conversions and formatters for speed, distance, altitude, pressure, temperature, fuel, and angle, plus ISA standard atmosphere calculations and compressible-flow aerodynamics.

Documentation

Part of the @squawk aviation library suite. See all packages on npm.

Installation

npm install @squawk/units

Usage

All exports are organized by domain namespace to keep call sites self-documenting:

import {
  speed,
  distance,
  altitude,
  pressure,
  temperature,
  fuel,
  angle,
  isa,
  format,
} from '@squawk/units';

// Speed conversions
const kmh = speed.knotsToKilometersPerHour(250);

// Distance conversions
const meters = distance.nauticalMilesToMeters(5);

// Altitude conversions
const feet = altitude.metersToFeet(3000);

// Pressure conversions and QNH/QFE
const hpa = pressure.inchesOfMercuryToHectopascals(29.92);
const kpa = pressure.hectopascalsToKilopascals(hpa);
const qfe = pressure.qnhToQfe(1013.25, 5280); // Denver elevation

// Temperature conversions
const celsius = temperature.fahrenheitToCelsius(59);

// Fuel conversions (density-aware volume <-> mass)
const jetALbs = fuel.gallonsToPounds(40, fuel.FUEL_DENSITY['Jet A']);
const avgasKg = fuel.litersToKilograms(200, fuel.FUEL_DENSITY['100LL']);

// Angle conversions
const radians = angle.degreesToRadians(45);

// ISA standard atmosphere
const isaTemp = isa.isaTemperatureCelsius(35000);
const tas = isa.trueAirspeedFromCalibratedKt(250, 35000); // CAS to TAS at altitude
const da = isa.densityAltitudeFt(5000, 30); // Pressure altitude + OAT

// Formatting with locale support
const altLabel = format.formatAltitude(3500); // "3,500 ft"
const flLabel = format.formatAltitude(35000); // "FL350"
const speedLabel = format.formatSpeed(0.82, 'mach'); // "M0.82"
const tempLabel = format.formatTemperature(15, 'C', {
  showISADeviation: true,
  altitudeFt: 0,
}); // "15°C (+0 ISA)"

Key Features

  • Speed: Knots, km/h, mph, m/s
  • Distance: Nautical miles, statute miles, kilometres, metres, feet
  • Altitude: Feet, metres (with flight-level awareness)
  • Pressure: inHg, hPa, mb, kPa, mmHg; QNH/QFE conversions; pressure altitude
  • Temperature: Celsius, Fahrenheit, Kelvin
  • Fuel: Gallons, litres, pounds, kilograms; density-aware volume <-> mass conversions with common fuel-type constants (100LL, Jet A, Jet A-1, Jet B)
  • Angle: Degrees, radians
  • ISA Atmosphere: Temperature and pressure profiles, TAS/CAS/Mach calculations, density altitude
  • Formatting: Locale-aware number formatting, flight-level conversion, ISA deviation display