uniku
Reference

Entry points

Ten stable generator entry points behind one consistent, type-safe API.

uniku exposes ten ID generation strategies with a consistent callable-generator API and format-specific typed helpers. The package root is intentionally not exported, so import a generator or metadata module directly:

import { uuidv4 } from 'uniku/uuid/v4'
import { uuidv7 } from 'uniku/uuid/v7'
import { ulid } from 'uniku/ulid'
import { typeid } from 'uniku/typeid'
import { cuidv2 } from 'uniku/cuid/v2'
import { nanoid } from 'uniku/nanoid'
import { ksuid } from 'uniku/ksuid'
import { objectid } from 'uniku/objectid'
import { xid } from 'uniku/xid'
import { tsid } from 'uniku/tsid'

Two metadata entry points round out the library:

ImportPurpose
uniku/errorsTyped, machine-readable input, parse, and buffer errors.
uniku/generatorsThe canonical ordered list of supported generator kinds.

Every generator exposes its own methods, such as isValid, toBytes, fromBytes, or a format-specific timestamp accessor where applicable.

Generator references

Read the reference for the strategy you use. The public method sections are generated from the TypeScript signatures and JSDoc in packages/uniku/src, so they stay aligned with the library source.

On this page