zombie processes nodejs
✓ Published0🌍 Public
Aalessioalex
Last edited May 18, 2015
Created on May 18, 2015
This example demonstrates how to create a detached child process in Node.js that continues running independently of its parent. The code uses the `child_process.spawn` API to launch a new Node.js process executing `zombie.js`, with all standard streams (`stdin`, `stdout`, `stderr`) set to `'ignore'` and the `detached: true` option enabled. By calling `child.unref()`, the parent process removes the child from its event loop, allowing the parent to exit while the child persists as a zombie process. The example references Stack Overflow guidance and Node.js documentation on detached processes, illustrating a pattern for background tasks.
AI-generated description