Advertisement
Void-voiD

Untitled

Dec 19th, 2018
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #!usr/bin/nodejs
  2. 'use-strict'
  3. console.log('test');
  4. const process = require('process');
  5. const fs = require('fs');
  6. console.log(process.argv);
  7. let t = {};
  8. t.wFT = true;
  9.  
  10. const f = (dir, len) => {
  11. const items = fs.readDirSync(dir, t);
  12. for (let i = 0; i < items.length; i++) {
  13. if (dirent.isDirectory(items[i], t)) {
  14. console.log(items[i]);
  15. f(items[i], len + 2);
  16. }
  17. else {
  18. console.log(items[i]);
  19. }
  20. }
  21. }
  22. if (process.argv.length === 2) {
  23. f(process.argv[1], 0);
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement