Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!usr/bin/nodejs
- 'use-strict'
- console.log('test');
- const process = require('process');
- const fs = require('fs');
- console.log(process.argv);
- let t = {};
- t.wFT = true;
- const f = (dir, len) => {
- const items = fs.readDirSync(dir, t);
- for (let i = 0; i < items.length; i++) {
- if (dirent.isDirectory(items[i], t)) {
- console.log(items[i]);
- f(items[i], len + 2);
- }
- else {
- console.log(items[i]);
- }
- }
- }
- if (process.argv.length === 2) {
- f(process.argv[1], 0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement