Practical TypeScript utilities for frontend work

Mazey provides focused helpers for URLs, dates, validation, objects, DOM operations, browser storage, resource loading, events, browser detection, and web performance. Import the functions you need from the package root.

npm install mazey

One flat API, several frontend jobs

Mazey keeps reusable functions available through a single package entry while documenting browser-only behavior and Node.js-compatible utilities separately.

Data and formatting

Validate numbers and strings, clone or freeze values, format dates and durations, and convert identifier styles.

Browser utilities

Work with URLs, DOM classes and styles, storage, cookies, resource loading, browser information, and custom events.

Typed package formats

Rollup publishes CommonJS, ESM, browser IIFE, and TypeScript declaration output while the website remains a separate build-time concern.

Install

Install from npm for module projects, or use the browser bundle from a CDN.

npm and TypeScript

Published declarations are included, so a separate types package is not required.

npm install mazey

Browser IIFE

Load the latest published browser bundle without updating the URL for each release.

<script src="https://cdn.jsdelivr.net/npm/mazey@latest/lib/mazey.min.js"></script>
<script>
  const value = mazey.formatDurationFromMs(90000);
</script>

Usage

Choose utilities only when their behavior and browser requirements match your project. Browser-only functions should stay behind browser runtime boundaries.

Read the complete typed API documentation
import {
  convertCamelToKebab,
  formatDurationFromMs,
  isValidEmail,
} from "mazey";

formatDurationFromMs(90000); // "1.5 minutes"
convertCamelToKebab("helloWorld"); // "hello-world"
isValidEmail("dev@example.com"); // true

Run public APIs in your browser

The playground exercises the same package-root utilities used by consumers and reports invalid input without hiding its explanatory content behind JavaScript.

Install the documentation website

Supporting browsers may offer an app installation prompt. The installed experience includes the website, playground, and API documentation; it does not alter the npm package or grant additional browser capabilities.