1

I am learning streams, child processes in Node.js, I am Windows user since childhood, had nothing to do with Unix/Linux nor C family lang, etc. which means I had none of conceptional knowledge before , so please no judge .

I faced and option of {silent: boolean} for child_process.fork() | (default: false)

Note : stdio array variant overrides {silent : boolean}

My question: besides being overwritten , does any variant of stdio (shown in screenshotted table below) have some equivalent for silent property , if property of silent would be used instead of stdio option ?

AFAIK , fork()'s stdio: [0,1,2, ipc] should be equivalent of {silent: true} [as answered hereby by Neil] , but keep in mind I may be mistaken so clarification would be highly appreciated !

String Value
"ignore" ["ignore", "ignore", "ignore"]
"pipe" ["pipe", "pipe", "pipe"]
"inherit" [process.stdin, process.stdout, process.stderr] or [0, 1, 2]
reposit96
  • 47
  • 6

1 Answers1

2

Setting stdio to "pipe" is equivalent to setting silent to true, and setting stdio to "inherit" is equivalent to setting silent to false.

  • I was close haha . Nevertheless appreciate a lot for editing & answering the question ! BTW, @Joseph Sible-Reinstate Monica I've seen these days so many people getting disappointed that Node.js API refs may not , but Guides for sure are poorly documented : I 've tried many books on packt but I see that O'reilly is my last chance . Any unsolicited advice for resources to avoid hogging stack overflow with such questions in the future whatsoever ? Thank you . – reposit96 Nov 18 '21 at 10:34
  • 1
    @reposit96 When the documentation is insufficient, check the source instead. [That's what I did](https://github.com/nodejs/node/blob/340b770d3f4c3b50a5d36c0776afd63d9b4f22de/lib/child_process.js#L157-L158). – Joseph Sible-Reinstate Monica Nov 18 '21 at 14:02