{"version":"1.0","type":"rich","title":"Daemonize a node process","description":"This example shows how to daemonize a Node.js process by re-spawning it in a new session with the `IS_DAEMONIC` environment variable set. It uses the `child_process.spawn` API to launch `/bin/sh` with a command that runs `setsid` on the original script, redirecting output to `/dev/null` and detaching it from the terminal. The code also escapes shell metacharacters in the process arguments to ensure safe quoting. After spawning, the parent process exits via a `stop()` call, leaving the daemon running independently.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-6132540?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}