how to generate a random salt in nodejs

JavaScript
var buf = crypto.randomBytes(16);
Source

Also in JavaScript: