Helpers 4 TypeScript
Production-ready TypeScript utility functions — modular, strictly typed, exhaustively tested.
Quick Links
Section titled “Quick Links”- Get Started — Installation and first import
- Browse Categories — 168 helpers across 13 categories
- GitHub · npm · License (LGPL-3.0)
What is helpers4?
Section titled “What is helpers4?”A collection of functional helpers to stop rewriting the same utility code across every project — each function does one thing, does it right, and ships with full type safety and exhaustive tests.
Born from 10 years of recoding the same domain-specific helpers across projects, helpers4 covers the gaps that popular general-purpose toolkits deliberately exclude: dates, URLs, semver, observables, promise guards. The Philosophy and the Radashi comparison pages explain the reasoning in detail.
- ✅ Tree-shakable — import one function, pay for one function
- ✅ Framework-agnostic — React, Vue, Svelte, Angular, or no framework at all
- ✅ Well-typed — strict TypeScript, no
any, full inference - ✅ Zero runtime dependencies — nothing pulled in at runtime
- ✅ Battle-tested — 100% coverage, >90% mutation score, property-based · contract · boundary · security tests
- ✅ Enterprise-grade — formal LGPL-3.0 license, audit-ready, predictable at scale
- ✅ AI-ready — exhaustive contracts make every function safe to call from generated or agentic code
What’s new in V2?
Section titled “What’s new in V2?”V2 is a major milestone with 40+ new helpers:
| 40+ new helpers | analyzeCommits, buildConventionalCommitRegex, formatSize, injectWordBreaks, isArrayBuffer, isBlob, isBuffer, isConventionalCommit, isFormData, isPrerelease, parseConventionalCommit, parsePackageRepository, safeJsonParse, stringify, truncate, and many more |
New commit category | Parse and analyze Conventional Commits messages with formal structure validation |
New version category | parse, compare, increment, stringify — semantic version operations with full SemVer 2.0.0 support |
Expanded type category | Guards for every major type: isTemporalInstant, isTemporalDuration, isTemporalPlainDate, isTemporalPlainDateTime, isPromise, isIterable, and more |
| Mutation testing | >90% score — tests verified to catch regressions, not just execute — dashboard |
| Property-based tests | Invariants validated against thousands of random inputs (fast-check) |
| Contract tests | Formal behavioral guarantees for each function |
| Boundary & security tests | Edge values and security-sensitive inputs (prototype pollution, injections) |
| Native API tracking | Standard JS equivalents documented, not re-implemented |
| New docs site | You’re reading it — built with Astro, fully searchable |
Comparisons
Section titled “Comparisons”Wondering how helpers4 stacks up against other utility libraries? See the comparisons section.
Name conflicts between categories
Section titled “Name conflicts between categories”Some helpers share the same name across multiple categories — for example, compact exists in both @helpers4/array and @helpers4/object because it is a genuinely different operation on a different data type. When you need both in the same file, use the standard ES module as rename:
See the full list in Name Conflicts.
Contributing
Section titled “Contributing”Found a bug or want to suggest a helper? Open an issue on the TypeScript repository.
Want to improve this documentation? Use the Edit page link at the bottom of any page, or open an issue on the website repository.