
Node.JS Cheat-sheet
Encode String to Base64
console.log(Buffer.from('This message will be encoded to base64', 'utf8').toString('base64'));
Decode String from Base64
console.log(Buffer.from('VGhpcyBtZXNzYWdlIHdpbGwgYmUgZW5jb2RlZCB0byBiYXNlNjQ=', 'base64').toString('utf8'));
Generate random UUID from console (oneliner)
console.log(require('crypto').randomUUID());
Replace all ocurrences of a string (Method 1)