liosk / uuid.js Goto Github PK
View Code? Open in Web Editor NEWRFC-compliant UUID Generator for JavaScript
License: Apache License 2.0
RFC-compliant UUID Generator for JavaScript
License: Apache License 2.0
I get an error when I am trying to load uuid.js in Webpack. Here is the error:
ERROR in ./build/components/uuid.js/src/uuid.js
Module not found: Error: Can't resolve 'crypto' in '/Users/liechtypo/sandbox/search-artifact/build/components/uuid.js/src'
@ ./build/components/uuid.js/src/uuid.js 102:57-74
The project, https://github.com/benchlab/KeplerUUID, copied your project without attribution and violated your license by claiming the author.
I've done a diff between the projects which could be found here, if you want to take a look at.
I'd suggest you talk to the project directly or report it to GitHub to takedown the violating repository.
I would like to use "UUID.js" in a TypeScript project. Unfortunately this project does not have a TypeScript definiton file (.dts
): https://www.npmjs.com/package/@types/uuidjs
I saw that "UUID.js" is well-documented and uses JSDoc. With JSDoc and tsd-jsdoc it's possible to auto-generate a *.d.ts
file.
I can create a Pull Request with the generated definition file (includig "tsd-jsdoc" setup) if you would accept it. ๐
crypto.getRandomValues()
is supported in Node, Chrome, Firefox, Safari, Edge, and IE 11 (with ms-
prefix).
UUID.js should be using said API instead of Math.random()
.
please considers tagging
git -a v1.0.0 tag 6daaf91
so we connect to that specific version (related to jspm/jspm-cli#1851)
Hey @LiosK, can you publish your package on npm, so that it can be used in Node.js projects? That would be great. ๐
By the way, we are using your library in Wire's web application: https://wire.com/en/legal/#licenses - Thanks for providing this good piece of software. ๐
When it's packed with webpack, the bundle is too large because of the polyfills of the crypto
module, you can try it with the simple require('uuidjs')
and webpack it !
So just adding browser
option to package.json
can make it used in browser.
I just simply offer a PR for you, it's better to extract cryptoPRNG
function out
got this error:
/home/kuba/projects/jcubic/koduj/akademia/quiz/node_modules/ts-node/dist/index.js:851
return old(m, filename);
^
Error [ERR_REQUIRE_ESM]: require() of ES Module /home/kuba/projects/jcubic/koduj/akademia/quiz/node_modules/uuidjs/dist/uuid.js from /home/kuba/projects/jcubic/koduj/akademia/quiz/utils.ts not supported.
Instead change the require of uuid.js in /home/kuba/projects/jcubic/koduj/akademia/quiz/utils.ts to a dynamic import() which is available in all CommonJS modules.
at require.extensions.<computed> [as .js] (/home/kuba/projects/jcubic/koduj/akademia/quiz/node_modules/ts-node/dist/index.js:851:20)
at Object.<anonymous> (/home/kuba/projects/jcubic/koduj/akademia/quiz/utils.ts:4:18)
at m._compile (/home/kuba/projects/jcubic/koduj/akademia/quiz/node_modules/ts-node/dist/index.js:857:29)
at require.extensions.<computed> [as .ts] (/home/kuba/projects/jcubic/koduj/akademia/quiz/node_modules/ts-node/dist/index.js:859:16)
at Object.<anonymous> (/home/kuba/projects/jcubic/koduj/akademia/quiz/app.ts:21:17)
at m._compile (/home/kuba/projects/jcubic/koduj/akademia/quiz/node_modules/ts-node/dist/index.js:857:29)
at require.extensions.<computed> [as .ts] (/home/kuba/projects/jcubic/koduj/akademia/quiz/node_modules/ts-node/dist/index.js:859:16)
at phase4 (/home/kuba/projects/jcubic/koduj/akademia/quiz/node_modules/ts-node/dist/bin.js:466:20
)
at bootstrap (/home/kuba/projects/jcubic/koduj/akademia/quiz/node_modules/ts-node/dist/bin.js:54:12)
at main (/home/kuba/projects/jcubic/koduj/akademia/quiz/node_modules/ts-node/dist/bin.js:33:12)
at Object.<anonymous> (/home/kuba/projects/jcubic/koduj/akademia/quiz/node_modules/ts-node/dist/bin.js:579:5) {
code: 'ERR_REQUIRE_ESM'
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.