@esmate/utils
v1.3.4
Published
JavaScript/TypeScript utils, functions, and classes in one package.
Maintainers
Readme
@esmate/utils
A 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.
Installation
npm install @esmate/utilsESToolkit Utilities
Access es-toolkit functions through the main package export.
import { delay, invariant } from "@esmate/utils";📚 Documentation: es-toolkit reference
Lodash Utilities
Access lodash functions reimplemented using es-toolkit's compatibility mode for familiar, drop-in replacements.
import { chunk, debounce } from "@esmate/utils/lodash";📚 Documentation: Lodash compatibility reference
Math Utilities
Leverage the full power of math.js for mathematical operations and calculations.
import { round, sqrt } from "@esmate/utils/math";📚 Documentation: math.js reference
String Utilities
Access string utilities for common string operations.
import { fixTypos, titleize } from "@esmate/utils/string";📚 Documentation: View source
titleize()
Converts strings to proper title case using the title package.
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"fixTypos()
Automatically corrects common typographical errors using typopo.
import { fixTypos } from "@esmate/utils/string";
const result = fixTypos("This is a text with typos..."); // "This is a text with typos…"