{"id":19475481,"url":"https://github.com/artdecocode/spawncommand","last_synced_at":"2026-05-15T22:38:36.720Z","repository":{"id":57367062,"uuid":"80890425","full_name":"artdecocode/spawncommand","owner":"artdecocode","description":"Spawn a ChildProcess with a promise property resolved on exit with stdout, stderr and code.","archived":false,"fork":false,"pushed_at":"2019-04-25T17:26:03.000Z","size":378,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-08T09:41:25.316Z","etag":null,"topics":["async","child-process","fork","javascript","node","nodejs","promise","spawn"],"latest_commit_sha":null,"homepage":"https://nodejs.tools","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/artdecocode.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2017-02-04T03:27:52.000Z","updated_at":"2019-04-25T17:26:04.000Z","dependencies_parsed_at":"2022-08-23T19:30:11.863Z","dependency_job_id":null,"html_url":"https://github.com/artdecocode/spawncommand","commit_stats":null,"previous_names":["sobesednik/spawncommand"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/artdecocode/spawncommand","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artdecocode%2Fspawncommand","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artdecocode%2Fspawncommand/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artdecocode%2Fspawncommand/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artdecocode%2Fspawncommand/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/artdecocode","download_url":"https://codeload.github.com/artdecocode/spawncommand/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artdecocode%2Fspawncommand/sbom","scorecard":{"id":208913,"data":{"date":"2025-08-11","repo":{"name":"github.com/artdecocode/spawncommand","commit":"baf242e35b8214230aee69a6f28288cb303be04b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T00:21:22.466Z","repository_id":57367062,"created_at":"2025-08-17T00:21:22.466Z","updated_at":"2025-08-17T00:21:22.466Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33082157,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T20:25:35.270Z","status":"ssl_error","status_checked_at":"2026-05-15T20:25:34.732Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["async","child-process","fork","javascript","node","nodejs","promise","spawn"],"created_at":"2024-11-10T19:33:06.508Z","updated_at":"2026-05-15T22:38:36.700Z","avatar_url":"https://github.com/artdecocode.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# spawnCommand\n\n[![npm version](https://badge.fury.io/js/spawncommand.svg)](https://npmjs.org/package/spawncommand)\n\n_SpawnCommand_ will run the `spawn` or `fork` methods from the `child_process` module, and add a `promise` property to the returned process instance. The promise will be resolved on process exit with an object consisting of `code`, `stdout` and `stderr` properties.\n\n```\nyarn add spawncommand\n```\n\n\u003cp align=\"center\"\u003e\u003ca href=\"#table-of-contents\"\u003e\u003cimg src=\".documentary/section-breaks/0.svg?sanitize=true\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n## Table Of Contents\n\n- [Table Of Contents](#table-of-contents)\n- [API](#api)\n  * [Types](#types)\n    * [`_spawncommand.ChildProcessWithPromise`](#type-_spawncommandchildprocesswithpromise)\n    * [`_spawncommand.PromiseResult`](#type-_spawncommandpromiseresult)\n  * [`spawn(module: string, args: string[], options?: SpawnOptions): ChildProcessWithPromise`](#spawnmodule-stringargs-stringoptions-spawnoptions-childprocesswithpromise)\n  * [`fork(module: string, args: string[], options?: ForkOptions): ChildProcessWithPromise`](#forkmodule-stringargs-stringoptions-forkoptions-childprocesswithpromise)\n- [Copyright](#copyright)\n\n\u003cp align=\"center\"\u003e\u003ca href=\"#table-of-contents\"\u003e\u003cimg src=\".documentary/section-breaks/1.svg?sanitize=true\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n## API\n\n_SpawnCommand_ can be used by importing the default `spawn` and named `fork` exports.\n\n```js\nimport spawn, { fork } from 'spawncommand'\n```\n\n\u003cp align=\"center\"\u003e\u003ca href=\"#table-of-contents\"\u003e\u003cimg src=\".documentary/section-breaks/2.svg?sanitize=true\" width=\"15\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n### Types\n\nThe package's main type is _ChildProcessWithPromise_ which enriches the standard _ChildProcess_ with a `promise` property.\n\n[`import('child_process').ChildProcess`](https://nodejs.org/api/child_process.html#child_process_class_childprocess) __\u003ca name=\"type-child_processchildprocess\"\u003e`child_process.ChildProcess`\u003c/a\u003e__\n\n__\u003ca name=\"type-_spawncommandchildprocesswithpromise\"\u003e`_spawncommand.ChildProcessWithPromise`\u003c/a\u003e__: A child process with an extra `promise` property.\n\n|       Name        |                         Type                          |                Description                 |\n| ----------------- | ----------------------------------------------------- | ------------------------------------------ |\n| __promise*__      | \u003cem\u003e!Promise\u0026lt;!_spawncommand.PromiseResult\u0026gt;\u003c/em\u003e | A promise resolved when the process exits. |\n| __spawnCommand*__ | \u003cem\u003estring\u003c/em\u003e                                       | The spawn arguments joined by whitespace.  |\n\n__\u003ca name=\"type-_spawncommandpromiseresult\"\u003e`_spawncommand.PromiseResult`\u003c/a\u003e__\n\n|    Name     |      Type       |                  Description                   |\n| ----------- | --------------- | ---------------------------------------------- |\n| __stdout*__ | \u003cem\u003estring\u003c/em\u003e | The accumulated result of the `stdout` stream. |\n| __stderr*__ | \u003cem\u003estring\u003c/em\u003e | The accumulated result of the `stderr` stream. |\n| __code*__   | \u003cem\u003enumber\u003c/em\u003e | The code with which the process exited.        |\n\n\u003cp align=\"center\"\u003e\u003ca href=\"#table-of-contents\"\u003e\u003cimg src=\".documentary/section-breaks/3.svg?sanitize=true\" width=\"15\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n### `spawn(`\u003cbr/\u003e\u0026nbsp;\u0026nbsp;`module: string,`\u003cbr/\u003e\u0026nbsp;\u0026nbsp;`args: string[],`\u003cbr/\u003e\u0026nbsp;\u0026nbsp;`options?: SpawnOptions,`\u003cbr/\u003e`): ChildProcessWithPromise`\n\nSpawns a command and returns a _ChildProcess_ instance with the `promise` property resolved on exit. The promise will be rejected if an error was encountered when trying to spawn the process.\n\n`import('child_process').SpawnOptions` __\u003ca name=\"type-child_processspawnoptions\"\u003e`child_process.SpawnOptions`\u003c/a\u003e__\n\n```js\nimport spawn from 'spawncommand'\n\n(async () =\u003e {\n  const { promise } = spawn('echo', ['hello world'])\n  const { stderr, stdout, code } =  await promise\n  console.log(JSON.stringify({\n    stderr, stdout, code,\n  }, null, 2))\n})()\n```\n```json5\n{\n  \"stderr\": \"\",\n  \"stdout\": \"hello world\\n\",\n  \"code\": 0\n}\n```\n\nThe returned object is a `ChildProcess` and all of its properties can be accessed in the standard way.\n\n```js\nimport spawnCommand from 'spawncommand'\n\n(async () =\u003e {\n  const { stdout, promise } = spawnCommand('echo', ['hello world'])\n\n  stdout.pipe(process.stdout)\n  await promise\n})()\n```\n```\nhello world\n```\n\n\u003cp align=\"center\"\u003e\u003ca href=\"#table-of-contents\"\u003e\u003cimg src=\".documentary/section-breaks/4.svg?sanitize=true\" width=\"15\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n### `fork(`\u003cbr/\u003e\u0026nbsp;\u0026nbsp;`module: string,`\u003cbr/\u003e\u0026nbsp;\u0026nbsp;`args: string[],`\u003cbr/\u003e\u0026nbsp;\u0026nbsp;`options?: ForkOptions,`\u003cbr/\u003e`): ChildProcessWithPromise`\n\nForks a Node.js module and adds a `promise` property to the returned _ChildProcess_.\n\n`import('child_process').ForkOptions` __\u003ca name=\"type-child_processforkoptions\"\u003e`child_process.ForkOptions`\u003c/a\u003e__\n\n```js\nimport { fork } from 'spawncommand'\n\n(async () =\u003e {\n  const { promise } = fork('node_modules/.bin/alanode',\n    ['example/spawn.js'], {\n      stdio: 'pipe',\n    })\n  const { stdout } =  await promise\n  console.log(stdout)\n})()\n```\n```json5\n{\n  \"stderr\": \"\",\n  \"stdout\": \"hello world\\n\",\n  \"code\": 0\n}\n```\n\nThe `pipe` option needs to be set in order to gather the output of the `stderr` and `stdout` streams (or an array for older versions of Node.js when [this does not work][2]).\n\n\u003cp align=\"center\"\u003e\u003ca href=\"#table-of-contents\"\u003e\u003cimg src=\".documentary/section-breaks/5.svg?sanitize=true\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n## Copyright\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth\u003e\n      \u003ca href=\"https://artd.eco\"\u003e\n        \u003cimg src=\"https://raw.githubusercontent.com/wrote/wrote/master/images/artdeco.png\" alt=\"Art Deco\" /\u003e\n      \u003c/a\u003e\n    \u003c/th\u003e\n    \u003cth\u003e© \u003ca href=\"https://artd.eco\"\u003eArt Deco\u003c/a\u003e   2019\u003c/th\u003e\n    \u003cth\u003e\n      \u003ca href=\"https://www.technation.sucks\" title=\"Tech Nation Visa\"\u003e\n        \u003cimg src=\"https://raw.githubusercontent.com/artdecoweb/www.technation.sucks/master/anim.gif\"\n          alt=\"Tech Nation Visa\" /\u003e\n      \u003c/a\u003e\n    \u003c/th\u003e\n    \u003cth\u003e\u003ca href=\"https://www.technation.sucks\"\u003eTech Nation Visa Sucks\u003c/a\u003e\u003c/th\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n[2]: https://github.com/nodejs/node/pull/10866\n\n\u003cp align=\"center\"\u003e\u003ca href=\"#table-of-contents\"\u003e\u003cimg src=\".documentary/section-breaks/-1.svg?sanitize=true\"\u003e\u003c/a\u003e\u003c/p\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartdecocode%2Fspawncommand","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartdecocode%2Fspawncommand","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartdecocode%2Fspawncommand/lists"}