npm install walk
----------------code----------------------------
var walk = require('walk');var files = [];// Walker optionsvar walker = walk.walk('..', { followLinks: false });walker.on('directory', function(root, stat, next) {// Add this file to the list of filesconsole.log("root = "+root)console.log(root + '/' + stat.name)files.push(root + '/' + stat.name);next();});walker.on('end', function() {console.log(files);});
沒有留言:
張貼留言