{"_id":"@simple-libs/child-process-utils","_rev":"4160279","name":"@simple-libs/child-process-utils","description":"A small set of utilities for child process.","dist-tags":{"latest":"1.0.2"},"maintainers":[{"name":"dangreen","email":""}],"time":{"modified":"2026-03-01T20:38:05.000Z","created":"2025-05-28T19:29:25.246Z","1.0.2":"2026-03-01T18:37:07.082Z","1.0.1":"2025-06-14T11:18:59.744Z","1.0.0":"2025-05-28T19:29:25.246Z"},"users":{},"author":{"name":"Dan Onoshko","email":"danon0404@gmail.com","url":"https://github.com/dangreen"},"repository":{"type":"git","url":"git+https://github.com/TrigenSoftware/simple-libs.git","directory":"packages/child-process-utils"},"versions":{"1.0.2":{"name":"@simple-libs/child-process-utils","type":"module","version":"1.0.2","description":"A small set of utilities for child process.","author":{"name":"Dan Onoshko","email":"danon0404@gmail.com","url":"https://github.com/dangreen"},"license":"MIT","homepage":"https://github.com/TrigenSoftware/simple-libs/tree/main/packages/child-process-utils#readme","funding":"https://ko-fi.com/dangreen","repository":{"type":"git","url":"git+https://github.com/TrigenSoftware/simple-libs.git","directory":"packages/child-process-utils"},"bugs":{"url":"https://github.com/TrigenSoftware/simple-libs/issues"},"keywords":["child_process","child","process","utilities","utils"],"engines":{"node":">=18"},"exports":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"dependencies":{"@simple-libs/stream-utils":"^1.2.0"},"_id":"@simple-libs/child-process-utils@1.0.2","_integrity":"sha512-/4R8QKnd/8agJynkNdJmNw2MBxuFTRcNFnE5Sg/G+jkSsV8/UBgULMzhizWWW42p8L5H7flImV2ATi79Ove2Tw==","_resolved":"/tmp/ef59b2fddfbfc341bb881db611c9ab1b/simple-libs-child-process-utils-1.0.2.tgz","_from":"file:simple-libs-child-process-utils-1.0.2.tgz","_nodeVersion":"20.20.0","_npmVersion":"10.8.2","dist":{"shasum":"cb182d310c9bed3ace200b26258e090d898a1736","size":3956,"noattachment":false,"key":"/@simple-libs/child-process-utils/-/@simple-libs/child-process-utils-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/@simple-libs/child-process-utils/download/@simple-libs/child-process-utils-1.0.2.tgz"},"_npmUser":{"name":"dangreen","email":"danon0404@gmail.com"},"directories":{},"maintainers":[{"name":"dangreen","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/child-process-utils_1.0.2_1772390226932_0.22729855539686517"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-03-01T18:37:07.082Z","publish_time":1772390227082,"_source_registry_name":"default","_cnpm_publish_time":1772390227082},"1.0.1":{"name":"@simple-libs/child-process-utils","type":"module","version":"1.0.1","description":"A small set of utilities for child process.","author":{"name":"Dan Onoshko","email":"danon0404@gmail.com","url":"https://github.com/dangreen"},"license":"MIT","homepage":"https://github.com/TrigenSoftware/simple-libs/tree/main/packages/child-process-utils#readme","funding":"https://ko-fi.com/dangreen","repository":{"type":"git","url":"git+https://github.com/TrigenSoftware/simple-libs.git","directory":"packages/child-process-utils"},"bugs":{"url":"https://github.com/TrigenSoftware/simple-libs/issues"},"keywords":["child_process","child","process","utilities","utils"],"engines":{"node":">=18"},"exports":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"dependencies":{"@types/node":"^22.0.0","@simple-libs/stream-utils":"^1.1.0"},"_id":"@simple-libs/child-process-utils@1.0.1","_integrity":"sha512-3nWd8irxvDI6v856wpPCHZ+08iQR0oHTZfzAZmnbsLzf+Sf1odraP6uKOHDZToXq3RPRV/LbqGVlSCogm9cJjg==","_resolved":"/tmp/98bdb5d61aeb184126baf34be8b82637/simple-libs-child-process-utils-1.0.1.tgz","_from":"file:simple-libs-child-process-utils-1.0.1.tgz","_nodeVersion":"18.20.8","_npmVersion":"10.8.2","dist":{"shasum":"75062207018fff34727364c5a77ee7d4289874ad","size":4015,"noattachment":false,"key":"/@simple-libs/child-process-utils/-/@simple-libs/child-process-utils-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/@simple-libs/child-process-utils/download/@simple-libs/child-process-utils-1.0.1.tgz"},"_npmUser":{"name":"dangreen","email":"danon0404@gmail.com"},"directories":{},"maintainers":[{"name":"dangreen","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/child-process-utils_1.0.1_1749899939560_0.6864924011712643"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-06-14T11:18:59.744Z","publish_time":1749899939744,"_source_registry_name":"default","_cnpm_publish_time":1749899939744},"1.0.0":{"name":"@simple-libs/child-process-utils","type":"module","version":"1.0.0","description":"A small set of utilities for child process.","author":{"name":"Dan Onoshko","email":"danon0404@gmail.com","url":"https://github.com/dangreen"},"license":"MIT","homepage":"https://github.com/TrigenSoftware/simple-libs/tree/master/packages/child-process-utils#readme","funding":"https://ko-fi.com/dangreen","repository":{"type":"git","url":"git+https://github.com/TrigenSoftware/simple-libs.git","directory":"packages/child-process-utils"},"bugs":{"url":"https://github.com/TrigenSoftware/simple-libs/issues"},"keywords":["child_process","child","process","utilities","utils"],"engines":{"node":">=18"},"exports":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"dependencies":{"@types/node":"^22.0.0","@simple-libs/stream-utils":"^1.0.0"},"scripts":{"clear:package":"del ./package","clear:dist":"del ./dist","clear":"del ./package ./dist ./coverage","build":"tsc -p tsconfig.build.json","lint":"eslint --parser-options tsconfigRootDir:. '**/*.{js,ts}'","test:unit":"vitest run --coverage","test:types":"tsc --noEmit","test":"run -p lint test:unit test:types"},"_id":"@simple-libs/child-process-utils@1.0.0","_integrity":"sha512-yUjZwZS8An/un6iyC0/HJMbWyEvp8y3RSW5DnxgfVXdDs9OLdulWMPs2EQLZkulsxCm3JohkB3JbyVsfeondkg==","_resolved":"/private/var/folders/hj/7x3kc5l135jbhq3tcwc_y2zh0000gn/T/c67e9dd2daaf936ab1010933447d4890/simple-libs-child-process-utils-1.0.0.tgz","_from":"file:simple-libs-child-process-utils-1.0.0.tgz","_nodeVersion":"22.4.1","_npmVersion":"10.8.1","dist":{"shasum":"34d8a81803e785056f469cc0233e2667642a261e","size":3910,"noattachment":false,"key":"/@simple-libs/child-process-utils/-/@simple-libs/child-process-utils-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@simple-libs/child-process-utils/download/@simple-libs/child-process-utils-1.0.0.tgz"},"_npmUser":{"name":"dangreen","email":"danon0404@gmail.com"},"directories":{},"maintainers":[{"name":"dangreen","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/child-process-utils_1.0.0_1748460565083_0.04381669291061896"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-05-28T19:29:25.246Z","publish_time":1748460565246,"_source_registry_name":"default","_cnpm_publish_time":1748460565246}},"readme":"# @simple-libs/child-process-utils\n\n[![ESM-only package][package]][package-url]\n[![NPM version][npm]][npm-url]\n[![Node version][node]][node-url]\n[![Dependencies status][deps]][deps-url]\n[![Install size][size]][size-url]\n[![Build status][build]][build-url]\n[![Coverage status][coverage]][coverage-url]\n\n[package]: https://img.shields.io/badge/package-ESM--only-ffe536.svg\n[package-url]: https://nodejs.org/api/esm.html\n\n[npm]: https://img.shields.io/npm/v/@simple-libs/child-process-utils.svg\n[npm-url]: https://www.npmjs.com/package/@simple-libs/child-process-utils\n\n[node]: https://img.shields.io/node/v/@simple-libs/child-process-utils.svg\n[node-url]: https://nodejs.org\n\n[deps]: https://img.shields.io/librariesio/release/npm/@simple-libs/child-process-utils\n[deps-url]: https://libraries.io/npm/@simple-libs%2Fchild-process-utils\n\n[size]: https://packagephobia.com/badge?p=@simple-libs/child-process-utils\n[size-url]: https://packagephobia.com/result?p=@simple-libs/child-process-utils\n\n[build]: https://img.shields.io/github/actions/workflow/status/TrigenSoftware/simple-libs/tests.yml?branch=main\n[build-url]: https://github.com/TrigenSoftware/simple-libs/actions\n\n[coverage]: https://coveralls.io/repos/github/TrigenSoftware/simple-libs/badge.svg?branch=main\n[coverage-url]: https://coveralls.io/github/TrigenSoftware/simple-libs?branch=main\n\nA small set of utilities for child process.\n\n## Install\n\n```bash\n# pnpm\npnpm add @simple-libs/child-process-utils\n# yarn\nyarn add @simple-libs/child-process-utils\n# npm\nnpm i @simple-libs/child-process-utils\n```\n\n## Usage\n\n```ts\nimport {\n  exitCode,\n  catchProcessError,\n  throwProcessError,\n  outputStream,\n  output\n} from '@simple-libs/child-process-utils'\n\n// Wait for a child process to exit and return its exit code\nawait exitCode(spawn())\n// Returns 0 if the process exited successfully, or the exit code if it failed\n\n// Catch error from a child process\nawait catchProcessError(spawn())\n// Returns the error if the process failed, or null if it succeeded\n\n// Throws an error if the child process exits with a non-zero code.\nawait throwProcessError(spawn())\n\n// Yields the stdout of a child process.\n// It will throw an error if the process exits with a non-zero code.\nfor await (chunk of outputStream(spawn())) {\n  console.log(chunk.toString())\n}\n\n// Collects the stdout of a child process into a single Buffer.\n// It will throw an error if the process exits with a non-zero code.\nawait output(spawn())\n// Returns a Buffer with the stdout of the process\n```\n","_attachments":{},"homepage":"https://github.com/TrigenSoftware/simple-libs/tree/main/packages/child-process-utils#readme","bugs":{"url":"https://github.com/TrigenSoftware/simple-libs/issues"},"license":"MIT"}