swatipatel25/uuid

Generate RFC-compliant UUIDs in JavaScript

⭐ 0 stars💬 0 comments

Files

📁 .github
📄 .gitignore105 B
📄 .npmrc38 B
📁 .vscode
📄 AUTHORS210 B
📄 CHANGELOG.md24.7 KB
📄 CONTRIBUTING.md582 B
📄 LICENSE.md1.1 KB
📄 README.md16 KB
📄 README_js.md16.2 KB
📄 biome.jsonc726 B
📄 bundlewatch.config.json1.2 KB
📁 examples
📄 lefthook.yml172 B
📄 package-lock.json467.5 KB
📄 package.json3.5 KB
📄 prettier.config.js131 B
📁 scripts
📁 src
📁 test
📄 tsconfig.json274 B
📄 wdio.conf.js1.8 KB

README

<!-- -- This file is auto-generated from README_js.md. Changes should be made there. --> # uuid [![CI](https://github.com/uuidjs/uuid/workflows/CI/badge.svg)](https://github.com/uuidjs/uuid/actions?query=workflow%3ACI) [![Browser](https://github.com/uuidjs/uuid/workflows/Browser/badge.svg)](https://github.com/uuidjs/uuid/actions/workflows/browser.yml) For the creation of [RFC9562](https://www.rfc-editor.org/rfc/rfc9562.html) (formerly [RFC4122](https://www.rfc-editor.org/rfc/rfc4122.html)) UUIDs - **Complete** - Support for all RFC9562 UUID versions - **Cross-platform** - Support for... - [Typescript](#support) - [Chrome, Safari, Firefox, and Edge](#support) - [NodeJS](#support) - [React Native / Expo](#react-native--expo) - **Secure** - Uses modern `crypto` API for random values - **Compact** - Zero-dependency, [tree-shakable](https://developer.mozilla.org/en-US/docs/Glossary/Tree_shaking) - **CLI** - [`uuid` command line](#command-line) utility <!-- prettier-ignore --> > [!NOTE] > > Starting with `uuid@12` CommonJS is no longer supported. See [implications](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c) and [motivation](https://github.com/uuidjs/uuid/issues/881) for details. ## Quickstart **1. Install** ```shell npm install uuid ``` **2. Create a UUID** ```javascript import { v4 as uuidv4 } from 'uuid'; uuidv4(); // ⇨ 'b18794e8-5d0d-417c-b361-ba38e78411b4' ``` For timestamp UUIDs, namespace UUIDs, and other options read on ... ## API Summary | | | | --- | --- | | [`uuid.NIL`](#uuidnil) | The nil UUID string (all zeros) | | [`uuid.MAX`](#uuidmax) | The max UUID string (all ones) | | [`uuid.parse()`](#uuidparsestr) | Convert UUID string to array of bytes | | [`uuid.stringify()`](#uuidstringifyarr-offset) | Convert array of bytes to UUID string | | [`uuid.v1()`](#uuidv1options-buffer-offset) | Generate a version 1 (timestamp) UUID | | [`uuid.v1ToV6()`](#uuidv1tov6uuid) | Convert a version 1 UUID to version 6 | | [`u
SocialRepo
Login

loading/repo...

Latest Updates

Discussion