Tiny Random UUID Generator In Vanilla JavaScript – giuuid

Category: Javascript | April 15, 2022
Author:gizellysteffanny
Views Total:431 views
Official Page:Go to website
Last Update:April 15, 2022
License:MIT

Preview:

Tiny Random UUID Generator In Vanilla JavaScript – giuuid

Description:

UUID (Universally Unique Identifier) is a 128-bit number used to identify information without any ambiguity. It is more suitable to use UUID than other kinds of mutable unique IDs because it guarantees uniqueness.

This post will introduce a super tiny and easy-to-use JS library to generate random UUID, which can be used in browsers and node.js. Let’s get started.

How to use it:

1. Install & download.

# Yarn
$ yarn add giuuid
# NPM
$ npm i giuuid

2. Import the giuuid.

// ES6+
import uuid from 'giuuid';
// CommonJS
const uuid = require('giuuid');

3. Generate a random UUID.

uuid();
=> 365d54d8-ed0f-3e58-8109-d45837df7e81

See Also:

You Might Be Interested In:


Leave a Reply