uuid
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|
The UUID (Universally Unique Identifier) npm package is a library for the creation of RFC4122 UUIDs, supporting versions 1, 3, 4, and 5. It's important to note that it is cross-platform friendly. It is sidely compatible with different environments such as CommonJS, ECMAScript Modules, NodeJS 12+ LTS releases, as well as various browsers including Chrome, Safari, Firefox, and Edge. Also, it works well with Webpack and rollup.js module bundlers and React Native/Expo. For providing cryptographically strong random values, it is considered secure. Additionally, this library has zero dependencies making it small, ideal for "tree shaking" packagers.
Using UUID in your project is easy and straightforward. To install the UUID package using npm, run npm install uuid
in your terminal. Then, you can import and use it in your JavaScript file. Use the ES6 module syntax import { v4 as uuidv4 } from 'uuid';
and then call uuidv4();
to create a random UUID. Similarly, with CommonJS syntax, use const { v4: uuidv4 } = require('uuid')
and call uuidv4();
. UUID has numerous other utilities that can be employed depending on your needs, and example codes are readily provided in the docs for your convenience.
For comprehensive documentation and further instructions, you can refer to the UUID GitHub page. Here you'll find extensive API documentation, elaborate usage examples, known issues, and more. This will provide you with all the information necessary to use this library to its fullest.