官网api例子看不懂系列= =
链接在这里: child_process_child_process
const spawn = require('child_process').spawn;`
const ls = spawn('ls', ['-lh', '/usr']);
ls.stdout.on('data', (data) => {
console.log(`stdout: ${data}`);
});
ls.stderr.on('data', (data) => {
console.log(`stderr: ${data}`);
});
ls.on('close', (code) => {
console.log(`child process exited with code ${code}`);
});
问题来了,这个
(data) => {
console.log(`stdout: ${data}`);
}
是一种什么语法?执行是可执行的,但是这语法。。小弟不才,不认识