{"name":"@npmcli/promise-spawn","version":"6.0.1","author":{"name":"GitHub Inc."},"license":"ISC","_id":"@npmcli/promise-spawn@6.0.1","maintainers":[{"name":"fritzy","email":"fritzy@github.com"},{"name":"darcyclarke","email":"darcy@darcyclarke.me"},{"name":"nlf","email":"quitlahok@gmail.com"},{"name":"gar","email":"gar+npm@danger.computer"},{"name":"lukekarrys","email":"luke@lukekarrys.com"}],"homepage":"https://github.com/npm/promise-spawn#readme","bugs":{"url":"https://github.com/npm/promise-spawn/issues"},"tap":{"nyc-arg":["--exclude","tap-snapshots/**"],"check-coverage":true},"dist":{"shasum":"2bf718579ad0ca2c5bd364c6a9de3e2fa6be2b00","tarball":"http://registry-npm.ywwl.com/@npmcli/promise-spawn/download/@npmcli/promise-spawn-6.0.1.tgz","fileCount":5,"integrity":"sha512-+hcUpxgx0vEpDJI9Cn+lkTdKLoqKBXFCVps5H7FujEU2vLOp6KwqjLlxbnz8Wzgm8oEqW/u5FeNAXSFjLdCD0A==","signatures":[{"sig":"MEQCIE3z/3+tUHKOImHZEgci992+PK7jfdhQB7Ky29nmp6A1AiAUartj0bOjS1ndG4NLfjMmOyqHgmcut6/wDmhDjAYDIw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11744,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjYXeAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpVYhAAjyPCpd7MlcWkmz/hK62s7rTgCMpTdh+k0hpZfvLnehfCcy2o\r\ndJuAlNJdEv7t/c6uu0KXLUnJYUCeJczZ7x8JAatMu9MmcWiPczG81Xw3eveM\r\nz6vvs/F0MEf4n5JkrVVaIw9+T726cabpgmGMAXt9WRxEIk7IoDquI3QZaTY6\r\nJJ3mhCXQ8GMPRwQd/Awsg8NUCLIctnHiMnKtdn6B96ZI9KZeZIJcqfuAxfN6\r\n4NgivBU5uIwgu0nHDOvMB/MMKvb93yqgq0mcvnt/UaeVCbwB4SL9Jr3Um+mJ\r\n+GBMsLX7Kumm9hT86ejXFCTfePqQI5xtKExyp6rA19O9aN8K6XCYNMHtgGIf\r\n33YhhaaOAsboJ983a/UGddBq3GBDUyJdMITSsPxZihVykvSg4ZSjkuXRLfcA\r\nvMvt317A3hY4gV2mgwwMUHA1CfK/MVYCuN817y0EfFYOxEX9rlDg0xzy0PAF\r\nTEmERP1lc5cWoWS8ylH8y/1RgKI1ni5Num1Btlh/4gsWk214by5rdqeR3WGf\r\nae+00VJXsMngVnu2g9k0N8uSyhIqxgb1p1DFHFlZrdPWilikFTppjvBIDqNG\r\nH4csRgUDYOoMAJicCyG6s9LoG4vL2xc4FqG+dO8Gaf9xfX/28Tnxi66oZ9ex\r\n/Paa3Uj98/HUJ6UOGJXvRpKypL4KTe6wfBc=\r\n=9vIb\r\n-----END PGP SIGNATURE-----\r\n","size":4931,"noattachment":false,"key":"/@npmcli/promise-spawn/-/@npmcli/promise-spawn-6.0.1.tgz"},"main":"./lib/index.js","engines":{"node":"^14.17.0 || ^16.13.0 || >=18.0.0"},"gitHead":"9693f8fb3549ac5c3cc2050e76d9e79b73ec3fd3","scripts":{"lint":"eslint \"**/*.js\"","snap":"tap","test":"tap","lintfix":"npm run lint -- --fix","postlint":"template-oss-check","postsnap":"npm run lintfix --","posttest":"npm run lint","template-oss-apply":"template-oss-apply --force"},"_npmUser":{"name":"nlf","email":"quitlahok@gmail.com"},"repository":{"url":"git+https://github.com/npm/promise-spawn.git","type":"git"},"_npmVersion":"9.0.1","description":"spawn processes the way the npm cli likes to do","directories":{},"templateOSS":{"version":"4.8.0","//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten."},"_nodeVersion":"16.16.0","dependencies":{"which":"^3.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tap":"^16.0.1","spawk":"^1.7.1","minipass":"^3.1.1","@npmcli/template-oss":"4.8.0","@npmcli/eslint-config":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/promise-spawn_6.0.1_1667331968286_0.5438479439993291","host":"s3://npm-registry-packages"},"readme":"# @npmcli/promise-spawn\n\nSpawn processes the way the npm cli likes to do.  Give it some options,\nit'll give you a Promise that resolves or rejects based on the results of\nthe execution.\n\n## USAGE\n\n```js\nconst promiseSpawn = require('@npmcli/promise-spawn')\n\npromiseSpawn('ls', [ '-laF', 'some/dir/*.js' ], {\n  cwd: '/tmp/some/path', // defaults to process.cwd()\n  stdioString: true, // stdout/stderr as strings rather than buffers\n  stdio: 'pipe', // any node spawn stdio arg is valid here\n  // any other arguments to node child_process.spawn can go here as well,\n}, {\n  extra: 'things',\n  to: 'decorate',\n  the: 'result',\n}).then(result => {\n  // {code === 0, signal === null, stdout, stderr, and all the extras}\n  console.log('ok!', result)\n}).catch(er => {\n  // er has all the same properties as the result, set appropriately\n  console.error('failed!', er)\n})\n```\n\n## API\n\n### `promiseSpawn(cmd, args, opts, extra)` -> `Promise`\n\nRun the command, return a Promise that resolves/rejects based on the\nprocess result.\n\nResult or error will be decorated with the properties in the `extra`\nobject.  You can use this to attach some helpful info about _why_ the\ncommand is being run, if it makes sense for your use case.\n\nIf `stdio` is set to anything other than `'inherit'`, then the result/error\nwill be decorated with `stdout` and `stderr` values.  If `stdioString` is\nset to `true`, these will be strings.  Otherwise they will be Buffer\nobjects.\n\nReturned promise is decorated with the `stdin` stream if the process is set\nto pipe from `stdin`.  Writing to this stream writes to the `stdin` of the\nspawned process.\n\n#### Options\n\n- `stdioString` Boolean, default `true`.  Return stdout/stderr output as\n  strings rather than buffers.\n- `cwd` String, default `process.cwd()`.  Current working directory for\n  running the script.  Also the argument to `infer-owner` to determine\n  effective uid/gid when run as root on Unix systems.\n- `shell` Boolean or String. If false, no shell is used during spawn. If true,\n  the system default shell is used. If a String, that specific shell is used.\n  When a shell is used, the given command runs from within that shell by\n  concatenating the command and its escaped arguments and running the result.\n  This option is _not_ passed through to `child_process.spawn`.\n- Any other options for `child_process.spawn` can be passed as well.\n\n### `promiseSpawn.open(arg, opts, extra)` -> `Promise`\n\nUse the operating system to open `arg` with a default program. This is useful\nfor things like opening the user's default browser to a specific URL.\n\nDepending on the platform in use this will use `start` (win32), `open` (darwin)\nor `xdg-open` (everything else). In the case of Windows Subsystem for Linux we\nuse the default win32 behavior as it is much more predictable to open the arg\nusing the host operating system.\n\n#### Options\n\nOptions are identical to `promiseSpawn` except for the following:\n\n- `command` String, the command to use to open the file in question. Default is\n   one of `start`, `open` or `xdg-open` depending on platform in use.\n","publish_time":1667331968510,"_cnpm_publish_time":1667331968510,"dist-tags":{"latest":"10.0.1","latest-8":"8.0.4","latest-9":"9.0.2"}}