{"id":21703566,"url":"https://github.com/codemonument/deno_puppet_process","last_synced_at":"2026-05-16T21:35:35.727Z","repository":{"id":258962886,"uuid":"874884685","full_name":"codemonument/deno_puppet_process","owner":"codemonument","description":"A wrapper around the native subcommand execution apis of deno (later: bun, node) to easily automate cli processes from the outside","archived":false,"fork":false,"pushed_at":"2024-10-22T14:49:48.000Z","size":60,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-10T00:57:35.515Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/codemonument.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-18T16:31:33.000Z","updated_at":"2024-10-22T14:50:08.000Z","dependencies_parsed_at":"2024-11-25T21:43:39.674Z","dependency_job_id":null,"html_url":"https://github.com/codemonument/deno_puppet_process","commit_stats":null,"previous_names":["codemonument/deno_puppet_process"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/codemonument/deno_puppet_process","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemonument%2Fdeno_puppet_process","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemonument%2Fdeno_puppet_process/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemonument%2Fdeno_puppet_process/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemonument%2Fdeno_puppet_process/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codemonument","download_url":"https://codeload.github.com/codemonument/deno_puppet_process/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemonument%2Fdeno_puppet_process/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33119608,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T18:38:32.183Z","status":"ssl_error","status_checked_at":"2026-05-16T18:38:29.903Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-11-25T21:33:35.047Z","updated_at":"2026-05-16T21:35:35.690Z","avatar_url":"https://github.com/codemonument.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Puppet Process\n\nA wrapper around the native subcommand execution apis of deno (later: bun, node) to easily automate cli processes from the outside.\n\nProvides:\n\n- Mode 1: Interactive Command execution\n\n  - Create a {@link PuppetProcess} object, including the command to run\n  - call {@link PuppetProcess.start} to spawn the command\n  - send input to the command as Uint8Array or string via {@link PuppetProcess.std_in} WritableStream\n  - receive output from the command as string via {@link PuppetProcess.std_out}, {@link PuppetProcess.std_err} or {@link PuppetProcess.std_all} ReadableStreams\n  - for graceful exit: wait for the command to finish via {@link PuppetProcess.waitForExit}\n    (for example: when sending an `exit` command to a shell)\n  - for hard exit: kill the long-running command via {@link PuppetProcess.kill}\n\n- Mode 2: One-Shot Command execution (same as Mode 1, but no need to kill the child process):\n  - Create a {@link PuppetProcess} object, including the command to run\n  - call {@link PuppetProcess.start} to spawn the command\n  - receive output from the command as string via {@link PuppetProcess.std_out}, {@link PuppetProcess.std_err} or {@link PuppetProcess.std_all} ReadableStreams\n  - wait for the command to finish via {@link PuppetProcess.waitForExit}\n\nExample cli: `cat`\n\n## Example - Run a one-shot cli (with Deno)\n\n```typescript\nimport {simpleCallbackTarget} from '@codemonument/rx-webstreams';\nimport {assertEquals, assertExists, assertRejects} from '@std/assert';\nimport {PuppetProcess} from '@codemonument/puppet-process/deno';\nimport {delay} from '@std/async';\n\nconst process = new PuppetProcess({\n\tcommand: `cat`,\n});\n\nprocess.std_out.pipeTo(\n\tsimpleCallbackTarget(chunk =\u003e {\n\t\tassertEquals(chunk, 'Hello, world!');\n\t})\n);\nconst writer = process.std_in.getWriter();\nwriter.write('Hello, world!');\n\nprocess.start();\n\nawait delay(50);\n// close the writer explicitly to avoid dangling stdin stream after child process has finished\nawait writer.close();\n\n// CAUTION: Some cli-tools, like \"cat\", will exit when the writer for stdin is closed,\n// since this closing sends an EOF signal to the child process!\n// SO: we only need to wait for exit here, instead of killing the process.\nawait process.waitForExit();\n```\n\n## Credits\n\n- draw inspiration from [deno_simple_exec](https://github.com/codemonument/deno_simple_exec)\n\n---\n\n# Changelog\n\n## 1.0.1 - 2024-10-22\n\n- remove annoying debug log in `PuppetProcess` constructor\n\n## 1.0.0 - 2024-10-22\n\n- first stable release\n- add optional `cwd` option to `PuppetProcess` constructor - changes the current working directory of the spawned process\n\n## 0.1.2 - 2024-10-21\n\n- add example for @codemonument/puppet-process/errors module\n\n## 0.1.1 - 2024-10-21\n\n- improved documentation, as suggested by jsr\n\n## 0.1.0 - 2024-10-21 - initial release\n\nFeatures:\n\n- creating a puppet process with deno\n- sending input to the process\n- receiving output from the process\n- waiting for the process to finish\n- killing the process\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodemonument%2Fdeno_puppet_process","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodemonument%2Fdeno_puppet_process","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodemonument%2Fdeno_puppet_process/lists"}