- Marked
UUID.genV6()
as stable - Updated documents with RFC 9562 verbiage
- Updated dev dependencies
- CHANGELOG.md to NPM package
- Updated TypeScript to 5.0
- Refined doc comment style
- Migrated to native ES Modules from global variable and CommonJS export
- Added named
UUID
export and removed default export - Removed
UUID.overwrittenUUID
property (a.k.a. no conflict mode)
- Added named
- Removed
node:crypto
module-based CSPRNG implementation- Now requires Web Crypto API to utilize cryptographically secure pseudorandom number generators
- Changed target ECMAScript version from ES3 to ES2016
- Removed uuid.core.js and bower.json from repository
- Fixed wrong return type declaration of
UUID.parse()
:UUID
->UUID | null
- Placed tighter type constraints on
UUID
class members- Marked constructor() as private
- Marked
UUID.FIELD_NAMES
,UUID.FIELD_SIZES
,UUID#intFields
,UUID#bitFields
, andUUID#hexFields
as read-only arrays/objects
- Migrated to TypeScript and transpilation from pure JavaScript
- Replaced manually written type declaration with auto-generated .d.ts
- Adopted class declaration syntax
- Applied Prettier style to source code
- Migrated to TypeDoc from JSDoc for API document generation
- Updated dev dependencies
Import the UUID
class using the ESM syntax:
<!-- HTML5 -->
-<script src="https://unpkg.com/uuidjs@^4"></script>
-<script>
+<script type="module">
+ import { UUID } from "https://unpkg.com/uuidjs@^5";
const uuid = UUID.generate();
</script>
// Node.js
-const UUID = require("uuidjs");
+import { UUID } from "uuidjs";
const uuid = UUID.generate();
Call static methods through the UUID
class, rather than importing them
directly:
// Node.js
-const { generate } = require("uuidjs");
-const uuid = generate();
+import { UUID } from "uuidjs";
+const uuid = UUID.generate();
Run type checking relating to the following items, as these items have different type declarations than those in v4:
UUID.parse()
UUID.FIELD_NAMES
UUID.FIELD_SIZES
new UUID()
UUID#intFields
UUID#bitFields
UUID#hexFields
Last version that:
- Retains ECMAScript 3 compatibility
- Supports Internet Explorer 6
- Registers
UUID
in global scope - Exports CommonJS entry point
- Accompanies uuid.core.js variant
- Ships with bower.json
- Uses
node:crypto
-based cryptographically secure pseudorandom number generator on Node.js