You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
posts/uuid-in-nodejs/
UUID (Universally Unique IDentifier) crypto - Module was added from Node.js 14.17.0 1 2 const crypto = require("crypto"); console.log(crypto.randomUUID()); uuid module: 1 2 3 const uuid = require("uuid"); console.log(
Here is a test v1 uuid: ${uuid.v1()}
); console.log(Here is a test v4 uuid: ${uuid.v4()}
); nanoid module: 1 2 3 4 5 6 7 const Nanoid = require("nanoid"); const NanoidAsync = require("nanoid/async"); console.log(UUID with Nano ID sync: ${Nanoid.nanoid()}
); (async function () { const nanoId = await NanoidAsync.nanoid(); console.log(UUID with Nano ID async: ${nanoId}
); })(); 👉 Demohttps://dev.ngockhuong.com/posts/uuid-in-nodejs/
Beta Was this translation helpful? Give feedback.
All reactions