Skip to content

Instantly share code, notes, and snippets.

@parvezmrobin
Last active July 13, 2019 13:32
Show Gist options
  • Save parvezmrobin/10c2e8fd0a2102ed17529cd0e0349e08 to your computer and use it in GitHub Desktop.
Save parvezmrobin/10c2e8fd0a2102ed17529cd0e0349e08 to your computer and use it in GitHub Desktop.
const fs = require('fs');
const virusChecker = require('virus-checker') // some non-existing pseudo library
const getFilesForProcessing = function* () {
const dir = 'path/to/directory/';
const fileNames = fs.readdirSync(dir);
for(const fileName of fileNames){
yield fs.readdirSync(dir + fileName);
}
}
virusChecker.check(getFilesForProcessing());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment