uuid is a JavaScript library that generates RFC-compliant UUIDs.
The library solves the problem of creating universally unique identifiers in JavaScript environments by implementing the RFC9562 specification. It provides functions to generate UUIDs using different methods: version 1 based on timestamps, version 3 using MD5 hashing with namespaces, version 4 using random values, version 5 using SHA-1 hashing with namespaces, version 6 as a reordered timestamp variant, and version 7 based on Unix Epoch time. The library also includes utilities to parse UUID strings into byte arrays, stringify byte arrays back into UUID format, validate UUID strings, and detect the RFC version of a given UUID. It uses the modern crypto API for generating secure random values.
Developers should choose this library if they need RFC-compliant UUID generation across multiple JavaScript environments. The tool supports TypeScript, all major browsers including Chrome, Safari, Firefox and Edge, Node.js, and React Native or Expo. It has zero dependencies and is tree-shakable, making it suitable for projects where bundle size matters. The library offers a command-line utility for generating UUIDs outside of code. Note that versions from 12 onwards no longer support CommonJS, requiring projects to use ES modules instead.
The project maintains active continuous integration workflows for both general testing and browser compatibility. Development activity shows consistent attention to cross-platform support and standards compliance, with the codebase written in TypeScript to provide type safety for users.