Created
August 23, 2017 01:53
-
-
Save nateabele/0c0db599d5181a5ac1d40f629547def3 to your computer and use it in GitHub Desktop.
Just reads a list from standard in to an array.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
// --Usage-- | |
// Bash: find `pwd` -type f | ./file_map.js | |
// Fish: find (pwd) -type f | ./file_map.js | |
const readline = require('readline'); | |
const files = []; | |
var rl = readline.createInterface({ | |
input: process.stdin, | |
output: process.stdout, | |
terminal: false | |
}); | |
rl.on('line', files.push.bind(files)); | |
rl.on('close', () => console.log(`Collected ${files.length} files`)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment