Zero-dependency JavaScript string utility library. "Lodash but for strings."
50+ pure functions across 9 modules. Published to npm. Dual export pattern for tree-shaking.
50+
Pure string functions
9 modules
Logical groupings
0 deps
Runtime dependencies
npm pub
Published as stringy-core
Module Architecture — 9 modules, dual export pattern, Intl API for formattingimport { fn } from 'stringy-core' · import { _s } from 'stringy-core'
stringy-core has zero runtime dependencies. All formatting (numbers, currencies, dates, relative times) uses the browser's built-in Intl API instead of pulling in date-fns or numeral. All algorithms (Levenshtein, balanced brackets) are self-contained. Nothing to audit, nothing to break.
pure functionsIntl APIzero deps
Export Design
Dual export: named + _s namespace
Two ways to import the library. Named exports (import { maskEmail }) are tree-shakeable — bundlers include only what's used. The _s namespace (import { _s }) gives a single convenience object with all 50+ functions — ideal for REPL use and quick scripts where bundle size doesn't matter.
tree-shaking_s namespaceESM
Quality Gates
Pre-commit hooks on every commit
Husky + lint-staged runs ESLint and Prettier before every commit. No malformed code reaches the repository. This was a deliberate choice over a CI-only approach — catching formatting issues locally is faster and avoids failed CI runs on trivial whitespace or style violations.
Huskylint-stagedESLintPrettier
Testing
Babel bridge — ESM source, CJS test runner
The source is native ESM but Jest runs on CJS. Babel transpiles at test time via a jest.config.js transform. This keeps the published package as clean ESM while letting Jest run without any special experimental flags. The Babel dependency is dev-only and never ships to consumers.
JestBabelESM→CJS bridge
Known Bug
isPalindrome returns string, not boolean
The current implementation returns the cleaned string instead of a boolean. The fix is one line: return cleaned === cleaned.split('').reverse().join('') — but the bug is tracked rather than silently patched, to keep it as a documented contribution opportunity in the Contribution Station.
tracked bugcontribution opportunity
Open Source Design
Contribution Station stubs
Several functions are intentionally left as stubs with detailed JSDoc comments and failing Jest tests. The stubs describe exactly what the function should do, what edge cases to handle, and what the test expects. First-time contributors have a clear task with a definition of done built in.