Created
April 15, 2018 02:49
-
-
Save realazthat/6e56ed907bfa32853d8235d686ec0b09 to your computer and use it in GitHub Desktop.
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
const {spawn} = require('child_process'); | |
const readline = require('readline'); | |
const ls = spawn('ls', ['-lh', '/usr']); | |
const rl = readline.createInterface({ | |
input: ls.stdout | |
}); | |
rl.on('line', (line) => { | |
console.log(line); | |
}); | |
ls.on('close', (code) => { | |
console.log(`code: ${code}`); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment