Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var walk = require("./lib/walk.js");
- var counter = 0;
- var dirs = 0;
- var files = 0;
- var then = new Date().getTime();
- process.argv.forEach(function(val, index, array) {
- if (index > 1) {
- var walker = walk(val);
- walker.on("directory", function (path, file, next) {
- dirs++;
- counter++;
- //console.log(path);
- next();
- });
- walker.on("file", function (path, file, next) {
- files++;
- counter++;
- //console.log(path + "/" + file.name);
- next();
- });
- walker.on("end", function() {
- var now = new Date().getTime();
- console.log("time:" + ((now-then)/1000).toFixed(2) + ",total:" + counter + ",dirs:" + dirs + ",files:" + files);
- });
- }
- });
Add Comment
Please, Sign In to add comment