Prints one random UUID v4 using Node's built-in crypto module. No dependencies — for when you need a quick unique ID for a test fixture, resource name, or trace ID.
#!/usr/bin/env node
// Print a random UUID v4.
'use strict';
const { randomUUID } = require('node:crypto');
console.log(randomUUID());
xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx) to
stdout, exit 0.
$ node uuid-gen.js
b0d3f6b0-6a3e-4b3a-9b0e-2f6a2b1c4d9e
crypto.randomUUID() (cryptographically secure RNG under the hood) — no third-party UUID package, no weaker Math.random()-based generation.