Packages

uuid

14.0.3 · 10 Oct 2026MIT260.8M / weekRepositoryHomepagenpmAtom feed

Your version

8.0.0

major29 Apr 2020Where it was published

8.3.2 is the newest release of 8.x.

In short

2 breaking3 new

  • breaking

    For native ECMAScript Module (ESM) usage in Node.js only named exports are exposed, there is no more default export.

  • breaking

    Deep requiring specific algorithms of this library like require('uuid/v4'), which has been deprecated in uuid@7, is no longer supported.

Security

1 advisory affects 8.0.0; 11.1.1 fixes them

Release note

Breaking changes

  • breaking

    For native ECMAScript Module (ESM) usage in Node.js only named exports are exposed, there is no more default export.

    -import uuid from 'uuid';
    -console.log(uuid.v4()); // -> 'cd6c3b08-0adc-4f4b-a6ef-36087a1c9869'
    +import { v4 as uuidv4 } from 'uuid';
    +uuidv4(); // ⇨ '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d'
  • breaking

    Deep requiring specific algorithms of this library like require('uuid/v4'), which has been deprecated in uuid@7, is no longer supported.

    Instead use the named exports that this module exports.

    For ECMAScript Modules (ESM):

    -import uuidv4 from 'uuid/v4';
    +import { v4 as uuidv4 } from 'uuid';
    uuidv4();

    For CommonJS:

    -const uuidv4 = require('uuid/v4');
    +const { v4: uuidv4 } = require('uuid');
    uuidv4();

Features

Bug Fixes

  • Add CommonJS syntax example to README quickstart section