JavaScript/TypeScript utils, functions, and classes in one package.
npm install @esmate/utilsA comprehensive utility library that consolidates powerful tools for modern JavaScript/TypeScript development. This
package provides convenient access to es-toolkit, lodash-compatible functions, math operations, and string manipulation
utilities through a unified interface.
``bash`
npm install @esmate/utils
---
Access es-toolkit functions through the main package export.
`ts`
import { delay, invariant } from "@esmate/utils";
📚 Documentation: es-toolkit reference
---
Access lodash functions reimplemented using es-toolkit's compatibility mode for familiar,
drop-in replacements.
`ts`
import { chunk, debounce } from "@esmate/utils/lodash";
📚 Documentation: Lodash compatibility reference
---
Leverage the full power of math.js for mathematical operations and calculations.
`ts`
import { round, sqrt } from "@esmate/utils/math";
📚 Documentation: math.js reference
---
Access string utilities for common string operations.
`ts`
import { fixTypos, titleize } from "@esmate/utils/string";
📚 Documentation: View source
Converts strings to proper title case using the title package.
`ts
import { titleize } from "@esmate/utils/string";
const title = titleize("hello world"); // "Hello World"
const chicagoTitle = titleize("love of my life", { style: "chicago" }); // "Love of My Life"
const specialTitle = titleize("i love ESMate", { special: ["ESMate"] }); // "I Love ESMate"
`
Automatically corrects common typographical errors using typopo.
`ts
import { fixTypos } from "@esmate/utils/string";
const result = fixTypos("This is a text with typos..."); // "This is a text with typos…"
``
---