@thi.ng/units
Version:
Extensible SI unit creation, conversions, quantities & calculations (incl. ~170 predefined units & constants)
16 lines (15 loc) • 462 B
JavaScript
import { defUnit, div } from "../unit.js";
import { ft, km, m, mi, nmi } from "./length.js";
import { h, s } from "./time.js";
const m_s = defUnit("m/s", "meter per second", div(m, s));
const km_h = defUnit("km/h", "kilometer per hour", div(km, h));
const ft_s = defUnit("ft/s", "foot per second", div(ft, s));
const mph = defUnit("mph", "mile per hour", div(mi, h));
const kn = defUnit("kn", "knot", div(nmi, h));
export {
ft_s,
km_h,
kn,
m_s,
mph
};