finds.dev

HubSpot/humanize

A simple utility library for making the web more humane. #hubspot-open-source

View on GitHub

★ 919JavaScriptMITupdated Nov 2023

// the take

A JavaScript utility library for formatting numbers, strings, and arrays into human-readable output — ordinals, file sizes, oxford commas, compact integers, and similar display helpers. It's a HubSpot internal tool that got open-sourced. Useful if you need several of these formatters and don't want to pull in separate micro-packages.

The oxford comma formatter handles edge cases (pluralization, custom overflow text) that most roll-your-own implementations miss. The `compactInteger` function gracefully falls back to scientific notation for numbers beyond trillions, which is a sensible design choice. The `pace` function for slow-rate descriptions is genuinely useful for dashboards showing infrequent events. Single-file source with no runtime dependencies.

Last touched in 2023 and the Travis CI badge links to a service that's effectively defunct — there's no signal that this is actively maintained. The source is written in what was CoffeeScript compiled to JS; the current repo ships pre-compiled JavaScript in `src/`, which is confusing and makes contribution awkward. No locale/i18n support for number formatting — `intComma` always uses commas and periods, so it breaks for European locales. `fileSize` uses binary calculation but labels output as 'Kb'/'Mb'/'Gb' (not 'KiB'/'MiB'), which is the classic SI/IEC mix-up that will confuse anyone who cares about the distinction.

We read the README, the directory tree and a key source file in July 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
919
Forks
72
Language
JavaScript
License
MIT
Last commit
1 Nov 2023

// nearby

If humanize isn't quite it.

All repos →