Ciro Santilli OurBigBook.com  Sponsor €¥ 中国独裁统治 China Dictatorship 新疆改造中心、六四事件、法轮功、郝海东、709大抓捕、2015巴拿马文件 邓家贵、低端人口、西藏骚乱
This example reads lines from a child process one by one, as soon as lines become fully available. Related:
nodejs/read_child_process_lines.js
#!/usr/bin/env node
const childProcess = require('child_process')
const readline = require('readline')
const p = childProcess.spawn('./count.js', ['2'])
;(async function() {
const rl = readline.createInterface({ input: p.stdout })
for await (const line of rl) {
  console.log(line)
}
})()

Ancestors

  1. Node.js example
  2. Node.js
  3. JavaScript
  4. List of programming languages
  5. Programming language
  6. Software
  7. Computer
  8. Information technology
  9. Area of technology
  10. Technology
  11. Ciro Santilli's Homepage