{"id":17771397,"url":"https://github.com/rootslab/herod","last_synced_at":"2026-04-24T11:38:35.658Z","repository":{"id":7445997,"uuid":"8787794","full_name":"rootslab/herod","owner":"rootslab","description":"Herod, an heartless killer / handler for ( long-running ) child processes.","archived":false,"fork":false,"pushed_at":"2014-02-22T03:06:57.000Z","size":348,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-02T18:11:11.730Z","etag":null,"topics":["child-process","nodejs","process-manager"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rootslab.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-03-14T23:34:11.000Z","updated_at":"2018-12-11T00:24:12.000Z","dependencies_parsed_at":"2022-09-02T17:08:54.988Z","dependency_job_id":null,"html_url":"https://github.com/rootslab/herod","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/rootslab/herod","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootslab%2Fherod","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootslab%2Fherod/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootslab%2Fherod/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootslab%2Fherod/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rootslab","download_url":"https://codeload.github.com/rootslab/herod/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootslab%2Fherod/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260399774,"owners_count":23003239,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["child-process","nodejs","process-manager"],"created_at":"2024-10-26T21:32:37.878Z","updated_at":"2026-04-24T11:38:30.636Z","avatar_url":"https://github.com/rootslab.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"###Herod.\n[![build status](https://travis-ci.org/rootslab/herod.png?branch=master)](https://travis-ci.org/rootslab/herod) [![NPM version](https://badge.fury.io/js/herod.png)](http://badge.fury.io/js/herod)\n\u003e Herod, an heartless killer / handler for ( long-running ) child processes.\n\u003e When the main process dies, it kills all registered ( long-running ) child process.\n\n###Install\n\n```bash\n$ npm install herod [-g]\n```\n\n\u003e __require__ and get an instance of Herod __singleton__:\n\n```javascript\nvar Herod  = require( 'herod' );\n```\n\n###Run Tests\n\n```bash\n$ cd herod/\n$ npm test\n```\n###Properties\n\n```javascript\n\n/*\n * Hash of alive child processes:\n * {\n *  'pid123': {\n *      name: 'cmd,\n *      process : .. \n *   },\n *   ...\n * }\n * \n */\nHerod.childrens : Object\n\n/*\n * Number of alive handled childrens.\n * ( it holds the cardinality of Herod.childrens object )\n */\nHerod.alive : Number\n\n/*\n * Enable console logging for Herod notice messages,\n * it defaults to false.\n */\nHerod.debug : Boolean\n\n// last received signal, like 'SIGINT', 'SIGTERM', ..\nHerod.lsignal : String\n```\n\n###Methods\n\n\u003e Arguments within [ ] are optional.\n\n```javascript\n/*\n * Create a child process through ChildProcess#spawn, then automatically\n * enlist / register it to Herod.\n * \n * It returns the child process or undefined if no child was added.\n * ( a ChildProcess is an instance of EventEmitter ).\n * \n * - cargs defaults to : [].\n * - copt defaults to : {\n *      cwd : '/tmp',\n *      stdio : 'pipe',\n *      detached : false\n *   }\n *\n * Note : { detached : true } to create a long-running child process.\n */\nHerod#spawn( String cmd [, Array cargs [, Object copt ] ] ) : EventEmitter\n\n/*\n * Adding a child process to handle.\n * It returns the child pid or undefined, if no child was added \n */\nHerod#enlist( EventEmitter child [, String name [, Array args [, Object copt ] ] ] ) : String\n\n/*\n * Kill a child process through its pid.\n * The signal defaults to 'SIGKILL'.\n */\nHerod#kill( Number pid, [ String signal [, Function cback ] ] ) : Boolean\n\n/*\n * Kill all child processes sending them the same signal.\n * The signal defaults to 'SIGKILL'.\n * It returns the number of alive processes.\n */\nHerod#genocide( [ String signal [, Function cback  ] ) : undefined\n\n/*\n * Specify a signal to send for killing all enlisted child processes\n * and the main process itself.\n * 'cback' will called on main process 'exit' event.\n */\nHerod#suicide( [ String signal [, Function cback ] ] ) : undefined\n\n/*\n * Spawn a daemon process for current script, exiting the main parent process.\n * It reloads / spawn the script in which Herod#daemonize is called, as a \n * long-running child process.\n *\n * default options are:\n * {\n *    stdin : 'ignore',\n *    stdout : 'ignore',\n *    stderr : 'ignore',\n *    env : process.env\n * }\n * for debugging, use process.stdin and process.stdout streams.\n */\nHerod#daemonize( [ Object options ] ) : undefined\n\n```\n\n### MIT License\n\n\u003e Copyright (c) 2012 \u0026lt; Guglielmo Ferri : 44gatti@gmail.com \u0026gt;\n\n\u003e Permission is hereby granted, free of charge, to any person obtaining\n\u003e a copy of this software and associated documentation files (the\n\u003e 'Software'), to deal in the Software without restriction, including\n\u003e without limitation the rights to use, copy, modify, merge, publish,\n\u003e distribute, sublicense, and/or sell copies of the Software, and to\n\u003e permit persons to whom the Software is furnished to do so, subject to\n\u003e the following conditions:\n\n\u003e __The above copyright notice and this permission notice shall be\n\u003e included in all copies or substantial portions of the Software.__\n\n\u003e THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\n\u003e EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\u003e MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n\u003e IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n\u003e CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n\u003e TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n\u003e SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootslab%2Fherod","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frootslab%2Fherod","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootslab%2Fherod/lists"}