Serious IDs are numeric, making them compatible with contexts that require numeric identifiers, such as database primary keys. Each ID stays under 53 bits — the maximum safe integer size in JavaScript — and fits comfortably in a 64-bit integer column in any database.
Serious IDs are sortable and monotonically increasing, so they work reliably as primary keys in distributed databases. They are guaranteed collision-free through the year 2255, even when multiple IDs are generated within the same millisecond, as long as a single Serious instance is responsible for generation.
npm i @nextform/serious
Import the Serious class and use the generate() method.
import { Serious } from '@nextform/serious'
Serious.generate() // => 1776801003243546