Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Tiny JS
  3. @lukeed/uuid

@lukeed/uuid

MITJavaScriptv2.0.1

A tiny (~230B) and fast UUID (v4) generator for Node.js and the browser, available in both non-secure and cryptographically secure modes.

GitHubGitHub
410 stars11 forks0 contributors

What is @lukeed/uuid?

@lukeed/uuid is a lightweight, high-speed library for generating RFC4122 Version 4 UUIDs (random-based unique identifiers). It solves the need for a minimal, fast, and reliable UUID generator in both Node.js and browser environments, offering a significant performance advantage over many other solutions.

Target Audience

Developers building applications in Node.js or the browser that require efficient, low-overhead generation of unique identifiers, particularly those concerned with bundle size and runtime performance.

Value Proposition

Developers choose @lukeed/uuid for its exceptional speed and tiny size, which outperforms alternatives like the `uuid` package, while providing the flexibility of both non-secure and cryptographically secure generation modes in a simple, well-optimized package.

Overview

A tiny (~230B)and fast UUID (V4) generator for Node and the browser

Use Cases

Best For

  • Generating unique identifiers in performance-critical applications
  • Reducing bundle size in frontend projects where every byte counts
  • Applications needing cryptographically secure UUIDs in the browser or Node.js
  • Projects that require compatibility across Node.js, ESM, and CommonJS environments
  • Replacing slower UUID libraries like `uuid` for V4 generation
  • High-throughput systems where UUID generation speed impacts overall performance

Not Ideal For

  • Projects requiring UUID versions other than v4 (e.g., time-based v1 or namespaced v5)
  • Applications needing built-in UUID validation, parsing, or serialization features
  • Environments lacking crypto support where secure UUIDs are mandatory (e.g., very old browsers without crypto.getRandomValues)
  • Teams wanting a comprehensive UUID library with all RFC4122 versions in a single package

Pros & Cons

Pros

Minuscule Bundle Size

The default mode is only ~231 bytes gzipped, minimizing impact on web bundles and making it ideal for frontend performance optimization.

Blazing Fast Performance

Benchmarks show over 6 million ops/sec in Node.js, significantly outpacing alternatives like the uuid package due to optimized buffer allocation and hexadecimal pair composition.

Flexible Security Modes

Offers both a fast non-secure mode using Math.random and a secure mode leveraging the environment's crypto module, catering to different security and performance needs.

Excellent Environment Support

Works in Node.js and all browsers with preconfigured ESM, CommonJS, and UMD builds, ensuring seamless integration across diverse project setups.

Cons

Single-Version Limitation

Only generates UUID v4; developers needing v1, v3, or v5 must use other libraries, limiting its utility for projects with diverse UUID requirements.

Secure Mode Dependency

The secure mode relies on the environment's crypto module, which may not be available in all contexts, such as legacy browsers or restricted environments, forcing a fallback to non-secure mode.

Breaking API Changes

Version 2.0.0 moved the secure export to a separate path, which could break existing implementations and require code updates during migration, as noted in the README.

Frequently Asked Questions

Quick Stats

Stars410
Forks11
Contributors0
Open Issues1
Last commit1 year ago
CreatedSince 2020

Tags

#tiny-library#cryptography#utility#node-js#browser#es-module#uuid-generator#performance

Included in

Tiny JS767
Auto-fetched 7 hours ago

Related Projects

nanoidnanoid

A tiny (118 bytes), secure, URL-friendly, unique string ID generator for JavaScript

Stars26,856
Forks861
Last commit1 day ago
uiduid

A tiny (130B to 205B) and fast utility to generate random IDs of fixed length

Stars667
Forks18
Last commit1 year ago
hexoidhexoid

A tiny (190B) and extremely fast utility to generate random IDs of fixed length

Stars204
Forks7
Last commit2 months ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub