You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BREAKING CHANGE: 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):
```javascript
import { v4 as uuidv4 } from 'uuid';
uuidv4();
```
For CommonJS:
```javascript
const { v4: uuidv4 } = require('uuid');
uuidv4();
```
No longer supported is this:
```javascript
const uuidv4 = require('uuid/v4'); // <== NO LONGER SUPPORTED!
uuidv4();
```
Copy file name to clipboardExpand all lines: README.md
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -363,6 +363,33 @@ import { v4 as uuidv4 } from 'uuid';
363
363
Workers](https://caniuse.com/#feat=cryptography) and we are not aware of a polyfill (let us know if
364
364
you find one, please).
365
365
366
+
## Upgrading From uuid\@7
367
+
368
+
### Only Named Exports Supported When Using with Node.js ESM
369
+
370
+
uuid\@7 did not come with native ECMAScript Module (ESM) support for Node.js. Importing it in
371
+
Node.js ESM consequently imported the CommonJS source with a default export. This library now comes
372
+
with true Node.js ESM support and only provides named exports.
373
+
374
+
Instead of doing:
375
+
376
+
```javascript
377
+
importuuidfrom'uuid';
378
+
uuid.v4();
379
+
```
380
+
381
+
you will now have to use the named exports:
382
+
383
+
```javascript
384
+
import { v4asuuidv4 } from'uuid';
385
+
uuidv4();
386
+
```
387
+
388
+
### Deep Requires No Longer Supported
389
+
390
+
Deep requires like `require('uuid/v4')`[which have been deprecated in
391
+
uuid\@7](#deep-requires-now-deprecated) are no longer supported.
Copy file name to clipboardExpand all lines: README_js.md
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -353,6 +353,33 @@ import { v4 as uuidv4 } from 'uuid';
353
353
Workers](https://caniuse.com/#feat=cryptography) and we are not aware of a polyfill (let us know if
354
354
you find one, please).
355
355
356
+
## Upgrading From uuid\@7
357
+
358
+
### Only Named Exports Supported When Using with Node.js ESM
359
+
360
+
uuid\@7 did not come with native ECMAScript Module (ESM) support for Node.js. Importing it in
361
+
Node.js ESM consequently imported the CommonJS source with a default export. This library now comes
362
+
with true Node.js ESM support and only provides named exports.
363
+
364
+
Instead of doing:
365
+
366
+
```javascript
367
+
importuuidfrom'uuid';
368
+
uuid.v4();
369
+
```
370
+
371
+
you will now have to use the named exports:
372
+
373
+
```javascript
374
+
import { v4asuuidv4 } from'uuid';
375
+
uuidv4();
376
+
```
377
+
378
+
### Deep Requires No Longer Supported
379
+
380
+
Deep requires like `require('uuid/v4')`[which have been deprecated in
381
+
uuid\@7](#deep-requires-now-deprecated) are no longer supported.
0 commit comments