{"name":"spawn-please","version":"4.0.0","description":"Easy and small child_process.spawn","license":"ISC","repository":{"type":"git","url":"git+https://github.com/raineorshine/spawn-please.git"},"author":{"name":"Raine Revere","url":"https://github.com/raineorshine"},"bugs":{"url":"https://github.com/raineorshine/spawn-please/issues"},"homepage":"https://github.com/raineorshine/spawn-please#readme","type":"module","engines":{"node":">=22"},"exports":{".":{"types":"./types/index.d.ts","default":"./src/index.js"}},"keywords":["promise","promisified","child_process","child process","exec","spawn","stdin","stdout","stderr"],"scripts":{"build":"tsc && prettier --write types","lint":"prettier --check . && tsc -p tsconfig.lint.json","lintfix":"prettier --write .","test":"vitest run"},"dependencies":{"cross-spawn":"^7.0.6"},"devDependencies":{"@types/cross-spawn":"^6.0.6","prettier":"^3.9.6","typescript":"^7.0.2","vitest":"^4.1.10"},"allowScripts":{"fsevents@2.3.3":true},"gitHead":"aac78c40da1c4e9186a898086ffe1cdd59ca5d87","_id":"spawn-please@4.0.0","_nodeVersion":"26.3.1","_npmVersion":"11.16.0","dist":{"integrity":"sha512-O/vKT23yJxXuZr25E1DPF05pZ7GQPr7ZKkqF4iVl3SsLAyxQ7fE6nyRXww2sSUSMcCpCfYO/eN9uuOdJ0NfLcQ==","shasum":"f3d3709aa472f39e1e7b816ad14ce317be36cc41","tarball":"http://registry-npm.ywwl.com/spawn-please/download/spawn-please-4.0.0.tgz","fileCount":5,"unpackedSize":7812,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQC30hXPcx5V3Wk1+M4OrMxM2tr8JNKDFMOsVmRRiYpk+QIhALahv+OmnaDQMgYFboxpKBjPT0Nv0QRyhu/V2i435xY+"}],"size":2959,"noattachment":false,"key":"/spawn-please/-/spawn-please-4.0.0.tgz"},"_npmUser":{"name":"raine","email":"raine@cybersemics.org"},"directories":{},"maintainers":[{"name":"raine","email":"raine@cybersemics.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/spawn-please_4.0.0_1788094006199_0.9201427824609911"},"_hasShrinkwrap":false,"readme":"# spawn-please\n\n[![npm version](https://img.shields.io/npm/v/spawn-please)](https://www.npmjs.com/package/spawn-please)\n\nEasy and small `child_process.spawn`.\n\n- Promise-based\n- Cross-platform\n- Pass stdin as an argument\n- Rejects on a non-zero exit code by default\n\n## Install\n\n```sh\nnpm install spawn-please\n```\n\n## Usage\n\n```typescript\n(\n  command: string,\n  args?: string[],\n  options?: Options,\n  spawnOptions?: any,\n): Promise<{\n  stdout: string\n  stderr: string\n  code: number | null\n}>\n```\n\n```js\nimport spawn from 'spawn-please'\n\nconst { stdout, stderr } = await spawn('printf', ['please?'])\n\nassert.equal(stdout, 'please?')\nassert.equal(stderr, '')\n```\n\n## Options\n\n- `rejectOnError: boolean` - Rejects with a `SpawnError` if the process exits with a non-zero exit code. Default: true.\n- `stdin: string` - Send stdin to the spawned child process.\n- `stdout: (data: string) => void` - Stream stdout by chunk.\n- `stderr: (data: string) => void` - Stream stderr by chunk.\n\n## Errors\n\nA process that exits with a non-zero exit code rejects with a `SpawnError`, which keeps the output that was collected before it failed:\n\n```js\nimport spawn, { SpawnError } from 'spawn-please'\n\ntry {\n  await spawn('npm', ['ls', '--json'])\n} catch (err) {\n  if (err instanceof SpawnError) {\n    console.log(err.code) // 1\n    console.log(err.stdout) // still usable, even though npm exited non-zero\n  }\n}\n```\n\nA process that cannot be spawned at all, e.g. the command is not installed, rejects with the underlying `ENOENT` error. `rejectOnError: false` does not apply to it, since nothing ran.\n\n## License\n\nISC © [Raine Revere](https://github.com/raineorshine)\n","publish_time":1788094006337,"_cnpm_publish_time":1788094006337,"dist-tags":{"latest":"4.0.0"}}