@thi.ng/units
Version:
Extensible SI unit creation, conversions, quantities & calculations (incl. ~170 predefined units & constants)
12 lines (11 loc) • 296 B
JavaScript
import { sr } from "./angle.js";
import { m2 } from "./area.js";
import { coherent, defUnit, div, mul } from "../unit.js";
const cd = defUnit("cd", "candela", coherent(6));
const lm = defUnit("lm", "lumen", mul(cd, sr));
const lx = defUnit("lx", "lux", div(lm, m2));
export {
cd,
lm,
lx
};