Last active
July 13, 2019 13:32
-
-
Save parvezmrobin/10c2e8fd0a2102ed17529cd0e0349e08 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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