A JavaScript library for formatting numbers with SI, IEC, and BS1852 prefixes. Supports binary (KiB/MiB), metric (k/M/G), and BS1852 (e.g., 4K7) styles. Current stable version 1.2.0. TypeScript types included. Lightweight with no dependencies. Comparable to filesize.js but with BS1852 support.
npm install prefix-siNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Showcases three formatting modes (metric, binary, BS1852) with the prefix function.
Use `import prefix from 'prefix-si'` instead of destructuring.
Use `import` syntax or use `require('prefix-si').default` if using CJS.Use explicit prefix style option instead.
When parsing BS1852 output, expect uppercase prefix letters.
Use a big number library for extremely large values.
Set `"module": "ESNext"` or use `const prefix = require('prefix-si')`.Use `import prefix from 'prefix-si'`.
Run `npm install prefix-si` and check spelling.
No dependency data recorded yet.