An RFC 4122 compliant UUID v4 generator compatible with browser and Node APIs.
- 3.5kb minified, with no dependencies
- RFC 4122 compliant UUID v4
- Isomorphic - it works in the browser as well as with Node.js, without use of browserify, a bundler, or other dependencies
npm install @teensy/uuid
yarn add @teensy/uuid
pnpm add @teensy/uuid
import uuid from '@teensy/uuid'
const id = uuid() // example output: 8b2e5e9e-2a5b-4e7b-8e1a-4b1d9a4e7f2a
If you intend to distribute your package via a manager (e.g., npm
, yarn
, etc), this template
includes standard-version.
To release a new version, run the following command:
pnpm run release
Canary versions are released automatically on every push to main
via CI. To use a canary version in your project, use @teensy/uuid@canary
.
MIT License
Copyright (c) 2023 Tom