uniku

Start here

Ten type-safe ID strategies behind one API, with the fastest implementation of each in our current CI benchmark.

uniku collects ten ID generation strategies behind one consistent, type-safe API: UUID v4/v7, ULID, TypeID, Nanoid, CUID v2, KSUID, ObjectID, XID, and TSID. In the current CI benchmark, every generator beats its dedicated npm alternative. 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