Socket
Socket
Sign inDemoInstall

uuid4

Package Overview
Dependencies
0
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    uuid4

Node UUID v4 Generator


Version published
Weekly downloads
73K
increased by5.52%
Maintainers
1
Install size
4.30 kB
Created
Weekly downloads
 

Readme

Source

uuid4

A Node.js module for generating and validation V4 UUIDs

NOTE: as of Version 2, legacy browsers are no longer supported, you can keep using 1.x if you need to support modern and legacy browsers.

Install

$ npm install uuid4

Usage

import uuid4 from "uuid4";

// Generate a new UUID
var id = uuid4();

// Validate a UUID as proper V4 format (case-insensitive)
uuid4.valid(id); // true

Direct in Browser or Deno

import uuid4 from 'https://cdn.jsdelivr.net/gh/tracker1/node-uuid4/browser.mjs';

// or

const { default: uuid4 } = await import('https://cdn.jsdelivr.net/gh/tracker1/node-uuid4/browser.mjs')

Deno

Use the canonical implementation instead.

import { v4 as uuid4 } from "https://deno.land/std/uuid/mod.ts";

const id = uuid4.generate();

console.log(id);
console.log(uuid4.validate(id));

License

ISC License

Keywords

FAQs

Last updated on 07 Aug 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc