uuid 8.0.0
8.0.0 (2020-04-29)
⚠ BREAKING CHANGES
-
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' -
Deep requiring specific algorithms of this library like
require('uuid/v4'), which has been deprecated inuuid@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
- native Node.js ES Modules (wrapper approach) (#423) (2d9f590), closes #245 #419 #342
- remove deep requires (#426) (daf72b8)