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