Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const fs = require('fs');
- function parseFolder(path){
- // console.log(path);
- const files=fs.readdirSync(path); //lecture des fichiers dans le dossier 'path'
- for(var file of files){
- if(fs.lstatSync(path+'/'+file).isDirectory()){ //si DOSSIER
- parseFolder(path+'/'+file);
- }
- else{ //SI FICHIER
- console.log(file);
- }
- }
- }
- parseFolder('.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement