Skip to content

Instantly share code, notes, and snippets.

@seafoam6
Created October 21, 2015 12:10
Show Gist options
  • Save seafoam6/e0a0b95cd727e1778e3d to your computer and use it in GitHub Desktop.
Save seafoam6/e0a0b95cd727e1778e3d to your computer and use it in GitHub Desktop.
var path ='/Volumes/FORGETMENOW';
var fs = require('fs');
fs.readdir(path, function(err, files){
var rando = Math.floor(Math.random() * files.length);
console.log(files[rando]);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment