Skip to content

Instantly share code, notes, and snippets.

@andy51002000
Created June 15, 2019 23:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andy51002000/f38a821781548b3047cb1e6f08445346 to your computer and use it in GitHub Desktop.
Save andy51002000/f38a821781548b3047cb1e6f08445346 to your computer and use it in GitHub Desktop.
Node.js list all files in a directory
const testFolder = './tests/';
const fs = require('fs');
fs.readdirSync(testFolder).forEach(file => {
console.log(file);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment