uniku

Start here

Eleven type-safe ID strategies behind one API, with measured performance and independent entry points.

uniku collects eleven ID generation strategies behind one consistent, type-safe API: UUID v4/v5/v7, ULID, TypeID, Nanoid, CUID v2, KSUID, ObjectID, XID, and TSID. Published benchmarks compare generation speed with dedicated npm alternatives for each format. Each strategy still has its own entry point, so your application ships only the code it imports.

The library contract

Every generator import returns a callable function with precise TypeScript signatures and the helpers that make sense for its format, such as isValid(), toBytes(), fromBytes(), or timestamp(). The library is ESM-only, built on web standards, and tested end to end across Node.js, Bun, Deno, browsers, and Cloudflare Workers. The stability contract defines the entry points, validation boundaries, and runtime support policy that take effect with uniku@1.0.0.

A CLI companion is available

Install @uniku/cli when you need an ID in a terminal, migration, or shell pipeline. It shares the library's formats but has its own release lifecycle.

On this page