Created
April 11, 2018 11:19
-
-
Save vdespa/bf0159bac6180a430380a93aa495a7ef to your computer and use it in GitHub Desktop.
Random file name
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const fileName = Math.random().toString(36).substring(7) + '-foo.txt'; | |
fs.writeFile(fileName, 'bar', function (error) { | |
if (error) { | |
console.error(error); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment