Be the first user to complete this post
|
Add to List |
nodejs: generate uuid / guid
node-uuid provide a simpler and reliable way to create unique id. It is rigorous implementation of RFC4122 (v1 and v4) UUIDs.
// npm i node-uuid
var uuid = require('node-uuid');
// Generate a v1 (time-based) id
uuid.v1();
// Generate a v4 (random) id
uuid.v4();
Also Read:
- Getting started with es6 iterators and iterables
- Resolved - Error: listen eaccess using nodejs and pm2
- What does npm start do in nodejs
- Testing promise sequence using mocha, chai, chai-as-promised, sinon
- Using es6 modules with simple examples
- querySelector vs getElementById
- Understanding semver versioning for your nodejs packages
- Understanding expressjs middleware with a visual example