Skip to main content

Package Managers

Install uniku using your preferred package manager:
pnpm add uniku
pnpm is the recommended package manager for optimal performance and disk space usage.

Requirements

uniku requires a JavaScript runtime that supports:
  • ESM modules (no CommonJS support)
  • Web Crypto API (globalThis.crypto)
  • Node.js v24.13.0 or higher (if using Node.js)
uniku is ESM-only. Make sure your package.json has "type": "module" or use .mjs file extensions.

Bundle Size

Only import what you use — each entry point is independently tree-shakeable:
ImportMinified + gzipped
uniku/uuid/v4~940 B
uniku/uuid/v7~1.1 KB
uniku/ulid~1.5 KB
uniku/cuid2~1.1 KB
uniku/nanoid~938 B
uniku/ksuid~1.0 KB
Thanks to separate entry points, your bundle only includes the ID generators you actually import. No barrel exports means perfect tree-shaking.

Example Bundle Impact

If you only import UUID v7:
import { uuidv7 } from 'uniku/uuid/v7'
Your bundle will increase by ~1.1 KB (minified + gzipped), regardless of how many other formats uniku supports.

Runtime Compatibility

uniku works in all JavaScript environments that support the Web Crypto API:

Node.js

Version 24.13.0 or higher

Deno

All versions with Web Crypto support

Bun

All versions

Cloudflare Workers

All versions

Vercel Edge

All versions

Browsers

All modern browsers (Chrome, Firefox, Safari, Edge)
No Node.js-specific APIs are used. uniku relies entirely on globalThis.crypto, making it truly universal.

Preview Releases

Every pull request gets a preview release via pkg.pr.new. You can install directly from a PR to test unreleased features:
pnpm add https://pkg.pr.new/jkomyno/uniku@123
Replace 123 with the actual PR number.
Preview releases are for testing only. Do not use them in production.

TypeScript Support

uniku is written in TypeScript and includes full type definitions. No additional @types packages are needed.
import { uuidv7, type UuidV7Options } from 'uniku/uuid/v7'

// Full TypeScript support with type inference
const id: string = uuidv7()

// Options are fully typed
const options: UuidV7Options = {
  msecs: Date.now(),
  seq: 0
}

Verify Installation

After installation, verify that uniku works correctly:
import { uuidv7 } from 'uniku/uuid/v7'

console.log(uuidv7())
// Should print something like: "018e5e5c-7c8a-7000-8000-000000000000"
If you see a UUID string printed, you’re all set!

Next Steps

Quick Start

Generate your first ID and learn the basics

API Reference

Explore the complete API documentation

Build docs developers (and LLMs) love