uniku
TypeScript ID generator for every JavaScript runtime
/uˈniːku/ — Maltese for “unique”
Why uniku?
Universal Runtime Support
Works everywhere: Node.js, Deno, Bun, Cloudflare Workers, Vercel Edge, and browsers using Web Crypto API
Six ID Formats
UUID v4/v7, ULID, CUID2, Nanoid, and KSUID — all in one library
Tree-Shakeable
Separate entry points mean you only bundle what you import. No barrel exports.
Byte-Level Access
Convert between ID strings and Uint8Array with built-in toBytes() and fromBytes()
Time-Ordered IDs
UUID v7, ULID, and KSUID provide sortable identifiers with monotonic sequencing
Modern Standards
Includes UUID v7 (RFC 9562) for time-ordered, sortable identifiers
Quick Example
Performance
Benchmarks comparing uniku string ID generation with equivalent npm packages:| Generator | uniku vs npm |
|---|---|
| ULID | 85× faster |
| CUID2 | 8× faster |
| KSUID | 1.5× faster |
| UUID v7 | 1.1× faster |
| Nanoid | ~comparable speed |
Choose Your ID Generator
UUID v4
Random UUID with maximum compatibility
UUID v7
Time-ordered UUID for database keys
ULID
Sortable, 26-character identifier
CUID2
Secure, collision-resistant IDs
Nanoid
Compact, URL-friendly IDs
KSUID
K-Sortable with high entropy
Get Started
Installation
Install uniku using your favorite package manager
Quickstart
Generate your first ID in under 2 minutes
CLI Tool
Command-line tool for generating and validating IDs
API Reference
Complete API documentation for all generators
