A flexible unit formatter for human-readable file size, time, and custom units. Current stable version 2.0.1, shipped as ESM with TypeScript types. Differentiates by allowing per-unit factors and ceils for precise control over unit bumping, using mixed SI/IEC standards for file sizes. Suitable for formatting bytes, durations, or any custom unit system.
npm install human-unitNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates default size formatting and custom time units with the humanUnit function.
Use import syntax or switch to dynamic import().
Use `import humanUnit from 'human-unit'` and `import { sizePreset } from 'human-unit'`.Ensure factors array has at least (units.length - 1) elements when using array form.
Ensure the `unit` option is one of the predefined units in the preset.
Use `import humanUnit from 'human-unit'` or `const humanUnit = require('human-unit').default`.Use import syntax or set `type: 'module'` in package.json.
No dependency data recorded yet.