← All procedures
node.kill
Kill a spawned Node.js process
CLI- Package
- @procedures/node · README
- Path
["node","kill"]- CLI
mark node kill --processId <string>- As data
{"$proc":["node","kill"],"input":{}}
Use it
In TypeScript
import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/node"; // registers its procedures
const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["node","kill"], { processId: "<processId>" });
console.log(JSON.stringify(result));From the command line
$ mark node kill --processId <string>
As data, in a program
{ "$proc": ["node", "kill"], "input": { "processId": "<processId>" } }Input
| Field | Type | Required | Default | Description |
|---|
processId | string | yes | | Process ID returned from node.spawn |
signal | string | no | | Signal to send (default: SIGTERM) |
Output
| Field | Type | Required | Default | Description |
|---|
success | boolean | yes | | True when the process ended |
exitCode | number | no | | The exit code, when the process exited |
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"processId": {
"type": "string",
"description": "Process ID returned from node.spawn"
},
"signal": {
"description": "Signal to send (default: SIGTERM)",
"type": "string"
}
},
"required": [
"processId"
]
},
"output": {
"type": "object",
"properties": {
"success": {
"type": "boolean",
"description": "True when the process ended"
},
"exitCode": {
"description": "The exit code, when the process exited",
"type": "number"
}
},
"required": [
"success"
],
"additionalProperties": {}
}
}