
Company News
Socket Joins New OpenJS Program to Fund Node.js Security Work
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.
Humanize values: file sizes, durations, relative time, numbers, pluralization. Zero deps.
Humanize values for humans — file sizes, durations, relative time, numbers, pluralization. Zero dependencies, ESM + CJS + TypeScript types.
npm install humanizex
import { bytes, duration, relativeTime, number, pluralize } from "humanizex";
bytes(1536); // "1.54 KB"
bytes(1048576, { binary: true }); // "1 MiB"
duration(3_900_000); // "1h 5m"
duration(1500); // "1s 500ms"
relativeTime(Date.now() - 180_000); // "3 minutes ago"
relativeTime("2030-01-01"); // "in 4 years"
number(1234567); // "1,234,567"
number(1234567.89, { separator: " ", decimal: "," }); // "1 234 567,89"
pluralize(1, "item"); // "1 item"
pluralize(3, "item"); // "3 items"
pluralize(2, "person", "people"); // "2 people"
| Fonction | Exemple | Options |
|---|---|---|
bytes(n, opts?) | "1.5 MB" | binary (1024/KiB), decimals, space |
duration(ms, opts?) | "1h 5m" | parts (segments), compact |
relativeTime(date, opts?) | "3 minutes ago" | now, locale (Intl.RelativeTimeFormat) |
number(n, opts?) | "1,234,567" | separator, decimal, decimals |
pluralize(n, sing, plur?) | "3 items" | pluriel par défaut +s |
relativeTime est locale-aware quand Intl.RelativeTimeFormat est disponible (passe { locale: "fr" }).
MIT © KIPDEV
FAQs
Humanize values: file sizes, durations, relative time, numbers, pluralization. Zero deps.
We found that humanizex demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Company News
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.

Security News
Two compromised GitHub Actions were re-enabled with malicious tags intact, exposing thousands of downstream repositories to Mini Shai-Hulud.

Research
/Security News
A malicious Firefox extension fetches its payload after installation to evade detection, steal Google session cookies, and automate account takeover.