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
Copy file name to clipboardExpand all lines: README.md
+20-11Lines changed: 20 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ For the creation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDs
17
17
-**Small** - Zero-dependency, small footprint, plays nice with "tree shaking" packagers
18
18
-**CLI** - Includes the [`uuid` command line](#command-line) utility
19
19
20
-
**Upgrading from `uuid@3.x`?** Your code is probably okay, but check out [Upgrading From `uuid@3.x`](#upgrading-from-uuid3x) for details.
20
+
**Upgrading from `uuid@3`?** Your code is probably okay, but check out [Upgrading From `uuid@3`](#upgrading-from-uuid3x) for details.
21
21
22
22
## Quickstart
23
23
@@ -418,7 +418,16 @@ These CDNs all provide the same [`uuidv4()`](#uuidv4options-buffer-offset) metho
418
418
419
419
Methods for the other algorithms ([`uuidv1()`](#uuidv1options-buffer-offset), [`uuidv3()`](#uuidv3name-namespace-buffer-offset) and [`uuidv5()`](#uuidv5name-namespace-buffer-offset)) are available from the files `uuidv1.min.js`, `uuidv3.min.js` and `uuidv5.min.js` respectively.
420
420
421
-
## "getRandomValues() not supported"
421
+
## Known issues
422
+
423
+
### Duplicate UUIDs (Googlebot)
424
+
425
+
This module may generate duplicate UUIDs when run in clients with _deterministic_ random number generators, such as [Googlebot crawlers](https://developers.google.com/search/docs/advanced/crawling/overview-google-crawlers). This can cause problems for apps that expect client-generated UUIDs to always be unique. Developers should be prepared for this and have a strategy for dealing with possible collisions, such as:
426
+
427
+
- Check for duplicate UUIDs, fail gracefully
428
+
- Disable write operations for Googlebot clients
429
+
430
+
### "getRandomValues() not supported"
422
431
423
432
This error occurs in environments where the standard [`crypto.getRandomValues()`](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues) API is not supported. This issue can be resolved by adding an appropriate polyfill:
424
433
@@ -438,11 +447,11 @@ Note: If you are using Expo, you must be using at least `react-native-get-random
438
447
439
448
[In Edge <= 18, Web Crypto is not supported in Web Workers or Service Workers](https://caniuse.com/#feat=cryptography) and we are not aware of a polyfill (let us know if you find one, please).
440
449
441
-
## Upgrading From `uuid@7.x`
450
+
## Upgrading From `uuid@7`
442
451
443
452
### Only Named Exports Supported When Using with Node.js ESM
444
453
445
-
`uuid@7.x` did not come with native ECMAScript Module (ESM) support for Node.js. Importing it in Node.js ESM consequently imported the CommonJS source with a default export. This library now comes with true Node.js ESM support and only provides named exports.
454
+
`uuid@7` did not come with native ECMAScript Module (ESM) support for Node.js. Importing it in Node.js ESM consequently imported the CommonJS source with a default export. This library now comes with true Node.js ESM support and only provides named exports.
446
455
447
456
Instead of doing:
448
457
@@ -460,24 +469,24 @@ uuidv4();
460
469
461
470
### Deep Requires No Longer Supported
462
471
463
-
Deep requires like `require('uuid/v4')`[which have been deprecated in `uuid@7.x`](#deep-requires-now-deprecated) are no longer supported.
472
+
Deep requires like `require('uuid/v4')`[which have been deprecated in `uuid@7`](#deep-requires-now-deprecated) are no longer supported.
464
473
465
-
## Upgrading From `uuid@3.x`
474
+
## Upgrading From `uuid@3`
466
475
467
-
"_Wait... what happened to `uuid@4.x` -`uuid@6.x`?!?_"
476
+
"_Wait... what happened to `uuid@4` thru`uuid@6`?!?_"
468
477
469
478
In order to avoid confusion with RFC [version 4](#uuidv4options-buffer-offset) and [version 5](#uuidv5name-namespace-buffer-offset) UUIDs, and a possible [version 6](http://gh.peabody.io/uuidv6/), releases 4 thru 6 of this module have been skipped.
470
479
471
480
### Deep Requires Now Deprecated
472
481
473
-
`uuid@3.x` encouraged the use of deep requires to minimize the bundle size of browser builds:
482
+
`uuid@3` encouraged the use of deep requires to minimize the bundle size of browser builds:
474
483
475
484
```javascript
476
485
constuuidv4=require('uuid/v4'); // <== NOW DEPRECATED!
477
486
uuidv4();
478
487
```
479
488
480
-
As of `uuid@7.x` this library now provides ECMAScript modules builds, which allow packagers like Webpack and Rollup to do "tree-shaking" to remove dead code. Instead, use the `import` syntax:
489
+
As of `uuid@7` this library now provides ECMAScript modules builds, which allow packagers like Webpack and Rollup to do "tree-shaking" to remove dead code. Instead, use the `import` syntax:
481
490
482
491
```javascript
483
492
import { v4asuuidv4 } from'uuid';
@@ -493,13 +502,13 @@ uuidv4();
493
502
494
503
### Default Export Removed
495
504
496
-
`uuid@3.x` was exporting the Version 4 UUID method as a default export:
505
+
`uuid@3` was exporting the Version 4 UUID method as a default export:
497
506
498
507
```javascript
499
508
constuuid=require('uuid'); // <== REMOVED!
500
509
```
501
510
502
-
This usage pattern was already discouraged in `uuid@3.x` and has been removed in `uuid@7.x`.
511
+
This usage pattern was already discouraged in `uuid@3` and has been removed in `uuid@7`.
503
512
504
513
----
505
514
Markdown generated from [README_js.md](README_js.md) by [](https://github.com/broofa/runmd)
Copy file name to clipboardExpand all lines: README_js.md
+20-11Lines changed: 20 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ For the creation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDs
29
29
-**Small** - Zero-dependency, small footprint, plays nice with "tree shaking" packagers
30
30
-**CLI** - Includes the [`uuid` command line](#command-line) utility
31
31
32
-
**Upgrading from `uuid@3.x`?** Your code is probably okay, but check out [Upgrading From `uuid@3.x`](#upgrading-from-uuid3x) for details.
32
+
**Upgrading from `uuid@3`?** Your code is probably okay, but check out [Upgrading From `uuid@3`](#upgrading-from-uuid3x) for details.
33
33
34
34
## Quickstart
35
35
@@ -424,7 +424,16 @@ These CDNs all provide the same [`uuidv4()`](#uuidv4options-buffer-offset) metho
424
424
425
425
Methods for the other algorithms ([`uuidv1()`](#uuidv1options-buffer-offset), [`uuidv3()`](#uuidv3name-namespace-buffer-offset) and [`uuidv5()`](#uuidv5name-namespace-buffer-offset)) are available from the files `uuidv1.min.js`, `uuidv3.min.js` and `uuidv5.min.js` respectively.
426
426
427
-
## "getRandomValues() not supported"
427
+
## Known issues
428
+
429
+
### Duplicate UUIDs (Googlebot)
430
+
431
+
This module may generate duplicate UUIDs when run in clients with _deterministic_ random number generators, such as [Googlebot crawlers](https://developers.google.com/search/docs/advanced/crawling/overview-google-crawlers). This can cause problems for apps that expect client-generated UUIDs to always be unique. Developers should be prepared for this and have a strategy for dealing with possible collisions, such as:
432
+
433
+
- Check for duplicate UUIDs, fail gracefully
434
+
- Disable write operations for Googlebot clients
435
+
436
+
### "getRandomValues() not supported"
428
437
429
438
This error occurs in environments where the standard [`crypto.getRandomValues()`](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues) API is not supported. This issue can be resolved by adding an appropriate polyfill:
430
439
@@ -444,11 +453,11 @@ Note: If you are using Expo, you must be using at least `react-native-get-random
444
453
445
454
[In Edge <= 18, Web Crypto is not supported in Web Workers or Service Workers](https://caniuse.com/#feat=cryptography) and we are not aware of a polyfill (let us know if you find one, please).
446
455
447
-
## Upgrading From `uuid@7.x`
456
+
## Upgrading From `uuid@7`
448
457
449
458
### Only Named Exports Supported When Using with Node.js ESM
450
459
451
-
`uuid@7.x` did not come with native ECMAScript Module (ESM) support for Node.js. Importing it in Node.js ESM consequently imported the CommonJS source with a default export. This library now comes with true Node.js ESM support and only provides named exports.
460
+
`uuid@7` did not come with native ECMAScript Module (ESM) support for Node.js. Importing it in Node.js ESM consequently imported the CommonJS source with a default export. This library now comes with true Node.js ESM support and only provides named exports.
452
461
453
462
Instead of doing:
454
463
@@ -466,24 +475,24 @@ uuidv4();
466
475
467
476
### Deep Requires No Longer Supported
468
477
469
-
Deep requires like `require('uuid/v4')`[which have been deprecated in `uuid@7.x`](#deep-requires-now-deprecated) are no longer supported.
478
+
Deep requires like `require('uuid/v4')`[which have been deprecated in `uuid@7`](#deep-requires-now-deprecated) are no longer supported.
470
479
471
-
## Upgrading From `uuid@3.x`
480
+
## Upgrading From `uuid@3`
472
481
473
-
"_Wait... what happened to `uuid@4.x` -`uuid@6.x`?!?_"
482
+
"_Wait... what happened to `uuid@4` thru`uuid@6`?!?_"
474
483
475
484
In order to avoid confusion with RFC [version 4](#uuidv4options-buffer-offset) and [version 5](#uuidv5name-namespace-buffer-offset) UUIDs, and a possible [version 6](http://gh.peabody.io/uuidv6/), releases 4 thru 6 of this module have been skipped.
476
485
477
486
### Deep Requires Now Deprecated
478
487
479
-
`uuid@3.x` encouraged the use of deep requires to minimize the bundle size of browser builds:
488
+
`uuid@3` encouraged the use of deep requires to minimize the bundle size of browser builds:
480
489
481
490
```javascript
482
491
constuuidv4=require('uuid/v4'); // <== NOW DEPRECATED!
483
492
uuidv4();
484
493
```
485
494
486
-
As of `uuid@7.x` this library now provides ECMAScript modules builds, which allow packagers like Webpack and Rollup to do "tree-shaking" to remove dead code. Instead, use the `import` syntax:
495
+
As of `uuid@7` this library now provides ECMAScript modules builds, which allow packagers like Webpack and Rollup to do "tree-shaking" to remove dead code. Instead, use the `import` syntax:
487
496
488
497
```javascript
489
498
import { v4asuuidv4 } from'uuid';
@@ -499,10 +508,10 @@ uuidv4();
499
508
500
509
### Default Export Removed
501
510
502
-
`uuid@3.x` was exporting the Version 4 UUID method as a default export:
511
+
`uuid@3` was exporting the Version 4 UUID method as a default export:
503
512
504
513
```javascript
505
514
constuuid=require('uuid'); // <== REMOVED!
506
515
```
507
516
508
-
This usage pattern was already discouraged in `uuid@3.x` and has been removed in `uuid@7.x`.
517
+
This usage pattern was already discouraged in `uuid@3` and has been removed in `uuid@7`.
0 commit comments