Simple library for managing node subprocesses
This tool easily lets you handle multiple sub processes when working in node environment.
Useful for launching your react app, backend and other microservices at the same time without having to have 5 terminal tabs open.
To install run the following commands:
yarn add @pixium-digital/child-manager
You can also use NPM
npm install @pixium-digital/child-manager
To leverage child manager simply add a configuration file to your project (see below for config details)
You can run thew following command:
yarn child-manager
By default the loaded config will be at the source of the project and be named childmanager.json
If you wish to load a different file just pass the config option.
yarn child-manager --config="./myconfig.json"
You can then access the manager at the following: http://localhost:7000
Here is an example configuration
{
"processes": [
{
"name": "Test Service",
"command": {
"executor": "node",
"args": ["TestService.js"],
"path": "./src/service",
"isWindows": false
},
"maxLogs": 200
},
{
"name": "Service 2",
"command": {
"executor": "yarn",
"args": ["start"],
"path": "./other-project/service",
"isWindows": false
},
"maxLogs": 200
}
],
"captureExit": true,
"longLive": false,
"debug": false
}
Generic configurations:
debug
: This will show more logs in the terminal in case something is not workinglongLive
: This is to force process to stay alive. Use carefully.captureExit
: This binds the exit of child manager so that it will kill all childs
Process configurations:
-
name
: The name of your service -
maxLogs
: The max number of logs to keep in memory (recommended 200) -
command
: This houses the command line that will be launchedexecutor
: The command executor (yarn, npm, node)args
: Array or extra arguments that should be passedpath
: Where the command should be executedisWindows
: Is this running on windows system? if yes paths and executors will be automatically changed to be compatible
You can use the following command for devlopment:
ts-node src/Cli.ts
dashboard
: The source for the react dashboardlib
: The compiled files for publishing on npm (automated)src
: The source code of the project__tests__
: Testing folder used to verify codedashboard
: The built react dashboard (automated)service
: Test service for testsutils
: Utility code for the projectChildManager
: The manager for all the processesChildProcess
: A process instanceCli
: The command line interface
PRs are welcome to contribute to the project
Please follow the following standard for commits:
:emoji: action(namespace): Details
Examples:
🚀 deploy(package): Updating package.json configuration for deployment
🐛 fix(child-manager): Fix buffer overflow issue
More info for gitmoji here https://gitmoji.dev/
Please follow the creating an issue template for any bugs or problems
Burlet Mederic [email protected]