Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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}`);
- });
Add Comment
Please, Sign In to add comment