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 

// Generate a v4 (random) id 

You may also like...

Leave a Reply

Your email address will not be published.