concept child process in category javascript

This is an excerpt from Manning's book Node.js in Practice.
Typically more interesting uses of file descriptors happen when you’re inheriting from a parent process or spawning a child process where descriptors are shared or passed. We’ll discuss this more when we look at child processes in a later chapter.
fork —Execute a Node module as a separate process, given a set of arguments, provide a streaming and evented interface like spawn, and also set up an interprocess communication (IPC) channel between the parent and child process. Throughout this chapter we’ll dive into how to get the most out of these methods, giving practical examples of where you’d want to use each. Later on, we’ll look into some other techniques to use when working with child processes: detaching processes, interprocess communication, file descriptors, and pooling.
Let’s look at a solution that uses both options. We want to ignore FD 0 (stdin) since we won’t be providing any input to the child process. But let’s capture any output from FDs 1 and 2 (stdout, stderr) just in case we need to do some debugging later on. Here’s how we can accomplish that:
![]()
This will disconnect the I/O between the child and parent processes. If we run this application, the output from the child process will end up in the log files.
You have a long-running external application that you want Node to start but then be able to exit with the child process still running.