Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

uuid

Package Overview
Dependencies
Maintainers
4
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uuid - npm Package Compare versions

Comparing version 7.0.3 to 8.0.0-beta.0

wrapper.mjs

3

dist/bytesToUuid.js

@@ -26,3 +26,2 @@ "use strict";

var _default = bytesToUuid;
exports.default = _default;
module.exports = exports.default;
exports.default = _default;

@@ -224,3 +224,2 @@ "use strict";

var _default = md5;
exports.default = _default;
module.exports = exports.default;
exports.default = _default;

@@ -23,3 +23,2 @@ "use strict";

var _default = md5;
exports.default = _default;
module.exports = exports.default;
exports.default = _default;

@@ -21,4 +21,2 @@ "use strict";

return getRandomValues(rnds8);
}
module.exports = exports.default;
}

@@ -14,4 +14,2 @@ "use strict";

return _crypto.default.randomBytes(16);
}
module.exports = exports.default;
}

@@ -95,3 +95,2 @@ "use strict";

var _default = sha1;
exports.default = _default;
module.exports = exports.default;
exports.default = _default;

@@ -23,3 +23,2 @@ "use strict";

var _default = sha1;
exports.default = _default;
module.exports = exports.default;
exports.default = _default;

@@ -107,3 +107,2 @@ "use strict";

var _default = v1;
exports.default = _default;
module.exports = exports.default;
exports.default = _default;

@@ -16,3 +16,2 @@ "use strict";

var _default = v3;
exports.default = _default;
module.exports = exports.default;
exports.default = _default;

@@ -40,3 +40,2 @@ "use strict";

var _default = v4;
exports.default = _default;
module.exports = exports.default;
exports.default = _default;

@@ -16,3 +16,2 @@ "use strict";

var _default = v5;
exports.default = _default;
module.exports = exports.default;
exports.default = _default;
The MIT License (MIT)
Copyright (c) 2010-2016 Robert Kieffer and other contributors
Copyright (c) 2010-2020 Robert Kieffer and other contributors

@@ -5,0 +5,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy

{
"name": "uuid",
"version": "7.0.3",
"version": "8.0.0-beta.0",
"description": "RFC4122 (v1, v4, and v5) UUIDs",

@@ -17,7 +17,11 @@ "commitlint": {

"bin": {
"uuid": "dist/bin/uuid"
"uuid": "./dist/bin/uuid"
},
"sideEffects": false,
"main": "dist/index.js",
"module": "dist/esm-node/index.js",
"main": "./dist/index.js",
"exports": {
"require": "./dist/index.js",
"import": "./wrapper.mjs"
},
"module": "./dist/esm-node/index.js",
"browser": {

@@ -34,36 +38,31 @@ "./dist/md5.js": "./dist/md5-browser.js",

"README.md",
"deprecate.js",
"dist",
"v1.js",
"v3.js",
"v4.js",
"v5.js"
"wrapper.mjs"
],
"devDependencies": {
"@babel/cli": "7.8.4",
"@babel/core": "7.8.7",
"@babel/preset-env": "7.8.7",
"@babel/core": "7.9.0",
"@babel/preset-env": "7.9.5",
"@commitlint/cli": "8.3.5",
"@commitlint/config-conventional": "8.3.4",
"@rollup/plugin-node-resolve": "7.1.1",
"@wdio/browserstack-service": "5.18.7",
"@wdio/cli": "5.18.7",
"@wdio/jasmine-framework": "5.18.6",
"@wdio/local-runner": "5.18.7",
"@wdio/spec-reporter": "5.18.7",
"@wdio/static-server-service": "5.16.10",
"@wdio/sync": "5.18.7",
"@rollup/plugin-node-resolve": "7.1.3",
"@wdio/browserstack-service": "6.0.12",
"@wdio/cli": "6.0.15",
"@wdio/jasmine-framework": "6.0.15",
"@wdio/local-runner": "6.0.15",
"@wdio/spec-reporter": "6.0.14",
"@wdio/static-server-service": "6.0.13",
"@wdio/sync": "6.0.15",
"babel-eslint": "10.1.0",
"babel-plugin-add-module-exports": "1.0.2",
"bundlewatch": "0.2.6",
"eslint": "6.8.0",
"eslint-config-prettier": "6.10.0",
"eslint-plugin-prettier": "3.1.2",
"husky": "3.0.9",
"jest": "25.1.0",
"lint-staged": "10.0.8",
"eslint-config-prettier": "6.10.1",
"eslint-plugin-prettier": "3.1.3",
"husky": "4.2.5",
"jest": "25.3.0",
"lint-staged": "10.1.3",
"npm-run-all": "4.1.5",
"prettier": "1.19.1",
"rollup": "1.32.0",
"rollup-plugin-terser": "5.2.0",
"prettier": "2.0.4",
"rollup": "2.6.1",
"rollup-plugin-terser": "5.3.0",
"runmd": "1.3.2",

@@ -73,20 +72,24 @@ "standard-version": "7.1.0"

"scripts": {
"examples:browser-webpack:build": "cd examples/browser-webpack && npm install && npm run build",
"examples:browser-rollup:build": "cd examples/browser-rollup && npm install && npm run build",
"examples:browser-esmodules:build": "cd examples/browser-esmodules && npm install && npm run build",
"examples:browser:webpack:build": "cd examples/browser-webpack && npm install && npm run build",
"examples:browser:rollup:build": "cd examples/browser-rollup && npm install && npm run build",
"examples:node:commonjs:test": "cd examples/node-commonjs && npm install && npm test",
"examples:node:esmodules:test": "cd examples/node-esmodules && npm install && npm test",
"lint": "npm run eslint:check && npm run prettier:check",
"eslint:check": "eslint src/ test/ examples/ *.js",
"eslint:fix": "eslint --fix src/ test/ examples/ *.js",
"pretest": "npm run build",
"pretest": "[ -n $CI ] || npm run build",
"test": "BABEL_ENV=commonjs node --throw-deprecation node_modules/.bin/jest test/unit/",
"pretest:browser": "npm run build && npm-run-all --parallel examples:**",
"pretest:browser": "npm run build && npm-run-all --parallel examples:browser:**",
"test:browser": "wdio run ./wdio.conf.js",
"pretest:node": "npm run build",
"test:node": "npm-run-all --parallel examples:node:**",
"test:pack": "./scripts/testpack.sh",
"prettier:check": "prettier --ignore-path .prettierignore --check '**/*.{js,jsx,json,md}'",
"prettier:fix": "prettier --ignore-path .prettierignore --write '**/*.{js,jsx,json,md}'",
"ci": "npm run lint && npm run test && npm run prettier:check && npm run docs:diff && npm run bundlewatch",
"bundlewatch": "( node --version | grep -vq 'v12' ) || ( npm run pretest:browser && bundlewatch --config bundlewatch.config.json )",
"bundlewatch": "npm run pretest:browser && bundlewatch --config bundlewatch.config.json",
"md": "runmd --watch --output=README.md README_js.md",
"docs": "( node --version | grep -q 'v12' ) && ( npm run build && runmd --output=README.md README_js.md )",
"docs:diff": "( node --version | grep -vq 'v12' ) || ( npm run docs && git diff --quiet README.md )",
"docs:diff": "npm run docs && git diff --quiet README.md",
"build": "./scripts/build.sh",
"prepack": "npm run build",
"release": "standard-version --no-verify"

@@ -114,6 +117,5 @@ },

"scripts": {
"postchangelog": "prettier --write CHANGELOG.md",
"postcommit": "npm run build"
"postchangelog": "prettier --write CHANGELOG.md"
}
}
}

@@ -12,3 +12,3 @@ <!--

- CommonJS, [ECMAScript Modules](#ecmascript-modules) and UMD builds
- Node 8, 10, 12
- Node 8, 10, 12, 14
- Chrome, Safari, Firefox, Edge, IE 11 browsers

@@ -24,3 +24,3 @@ - Webpack and rollup.js module bundlers

## Quickstart - Node.js/CommonJS
## Quickstart

@@ -43,2 +43,4 @@ ```shell

ECMAScript Module syntax:
```javascript

@@ -49,2 +51,9 @@ import { v4 as uuidv4 } from 'uuid';

CommonJS syntax:
```javascript
const { v4: uuidv4 } = require('uuid');
uuidv4(); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed'
```
### Create Version 1 (Timestamp) UUIDs

@@ -54,3 +63,3 @@

import { v1 as uuidv1 } from 'uuid';
uuidv1(); // ⇨ '2c5ea4c0-4067-11e9-8b2d-1b9d6bcdbbfd'
uuidv1(); // ⇨ '2c5ea4c0-4067-11e9-8bad-9b1deb4d3b7d'
```

@@ -141,13 +150,13 @@

// [
// 155, 29, 235, 77, 59,
// 125, 75, 173, 155, 221,
// 43, 13, 123, 61, 203,
// 109
// 27, 157, 107, 205, 187,
// 253, 75, 45, 155, 93,
// 171, 141, 251, 189, 75,
// 237
// ]
uuidv4(null, buffer, 16); // ⇨
// [
// 27, 157, 107, 205, 187, 253, 75, 45,
// 155, 93, 171, 141, 251, 189, 75, 237,
// 155, 29, 235, 77, 59, 125, 75, 173,
// 155, 221, 43, 13, 123, 61, 203, 109,
// 27, 157, 107, 205, 187, 253, 75, 45,
// 155, 93, 171, 141, 251, 189, 75, 237
// 155, 221, 43, 13, 123, 61, 203, 109
// ]

@@ -202,13 +211,12 @@ ```

// [
// 44, 94, 164, 192, 64,
// 103, 17, 233, 146, 52,
// 27, 157, 107, 205, 187,
// 253
// 44, 94, 164, 192, 64, 103,
// 17, 233, 146, 52, 155, 29,
// 235, 77, 59, 125
// ]
uuidv1(null, arr, 16); // ⇨
// [
// 44, 94, 164, 192, 64, 103, 17, 233,
// 146, 52, 27, 157, 107, 205, 187, 253,
// 44, 94, 164, 193, 64, 103, 17, 233,
// 146, 52, 27, 157, 107, 205, 187, 253
// 44, 94, 164, 192, 64, 103, 17, 233,
// 146, 52, 155, 29, 235, 77, 59, 125,
// 44, 94, 164, 193, 64, 103, 17, 233,
// 146, 52, 155, 29, 235, 77, 59, 125
// ]

@@ -299,7 +307,8 @@ ```

For usage in the browser `uuid` provides support for [ECMAScript
Modules](https://www.ecma-international.org/ecma-262/6.0/#sec-modules) (ESM) that enable
tree-shaking for bundlers, like [rollup.js](https://rollupjs.org/guide/en/#tree-shaking)
([example](./examples/browser-rollup/)) and [webpack](https://webpack.js.org/guides/tree-shaking/)
([example](./examples/browser-webpack/)).
This library comes with [ECMAScript
Modules](https://www.ecma-international.org/ecma-262/6.0/#sec-modules) (ESM) support for Node.js
versions that support it ([example](./examples/node-esmodules/)) as well as bundlers like
[rollup.js](https://rollupjs.org/guide/en/#tree-shaking) ([example](./examples/browser-rollup/))
and [webpack](https://webpack.js.org/guides/tree-shaking/)
([example](./examples/browser-webpack/)) (targeting both, Node.js and browser environments).

@@ -311,5 +320,2 @@ ```javascript

There is experimental native ESM support for [the browser](./examples/browser-esmodules/) but it
should not be considered ready for production use and may change or disappear in future releases.
To run the examples you must first create a dist build of this library in the module root:

@@ -369,2 +375,29 @@

## Upgrading From uuid\@7
### Only Named Exports Supported When Using with Node.js ESM
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.
Instead of doing:
```javascript
import uuid from 'uuid';
uuid.v4();
```
you will now have to use the named exports:
```javascript
import { v4 as uuidv4 } from 'uuid';
uuidv4();
```
### Deep Requires No Longer Supported
Deep requires like `require('uuid/v4')` [which have been deprecated in
uuid\@7](#deep-requires-now-deprecated) are no longer supported.
## Upgrading From uuid\@3

@@ -371,0 +404,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc