{"name":"@npmcli/promise-spawn","version":"1.3.1","author":{"url":"https://izs.me","name":"Isaac Z. Schlueter","email":"i@izs.me"},"license":"ISC","_id":"@npmcli/promise-spawn@1.3.1","maintainers":[{"name":"nlf","email":"quitlahok@gmail.com"},{"name":"ruyadorno","email":"ruyadorno@hotmail.com"},{"name":"darcyclarke","email":"darcy@darcyclarke.me"},{"name":"isaacs","email":"i@izs.me"}],"homepage":"https://github.com/npm/promise-spawn#readme","bugs":{"url":"https://github.com/npm/promise-spawn/issues"},"tap":{"check-coverage":true},"dist":{"shasum":"232282faa4f1b6653c93361d83a367d6d117c9c3","tarball":"http://registry-npm.ywwl.com/@npmcli/promise-spawn/download/@npmcli/promise-spawn-1.3.1.tgz","fileCount":4,"integrity":"sha512-S+I+ADqj66+ZpmmmvWXdNQkVyvikMYm/yrlk7xzoF6qf8AqL26yLwaxn0/ZTB0r3j1pur8Q/lyxL8yg4fZI76A==","signatures":[{"sig":"MEUCIDeTFaDRGkp96Q22pk8mGrrnh+6HRzfJj17jHZSrNBQfAiEAtwCMDu7Kufj3zslqKHzk5RLaxVtvL9O/L6SEPpXQ3WE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6112,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmGKYCRA9TVsSAnZWagAAdx4P/iGbcxxnRtN7Awlodgi+\n/m+iDa0Nf3LQwJEGMeBMv5aLx2eJw3o66fJHTHsYfEDc7MPimP7Cnnhpv3E4\n8uacyRabvuUcYtf3qMZbBB0gCRHfaBxRgtdh59dqMsnvOhzTMoaFVxoHt5/r\nU0T2+4OBoj284bezOxI9A+Xd83fTGkxsVZRzJ+t0mVmFAGf2BgitMgohhVP7\n/hdaNaYL3QFg1sTTB+qK3hfUXjNDDhjdnEsgMGWcDt5T8ez8048elToc3hNP\nqbY7d/aSVhfnUwllX6khHzT1i7ag88ypwdn1HPy2u5ABwKQ9vYfzbgtpirk9\nbaGtU90fzrDe7jFZypM+aKHLNEMawA9beuQ5cJDHvbMqUh2jbqiW25Txs3wb\n0+fFDO8lfxM/4JChwZtKhtlJZz8p9TKQDlJVSGM2SSwRWgY7of2ZnAU1jxnS\nK0wNdmPehFio//86jRfnhW8XdMbwXDiTyu4ZzK3L3sJ6caN3LKpnPhWv7h3i\noGnmkTnuvzul/p6UfiS8uhJ8ENgMjkOpGTq70Myzf7PrbhHd4384kYF99Zfc\nnlq3fe4ZWmE7pz9QXv8pFtTU2BGdCviavr/C9pdBuUYmFg7++kzVGLryXaNB\n/Xo43pr6yeYLS7/kZ3NpNVgZ11GJ6O8Ma2MayFTxKxLHXAZzoxG6tQWgVuC9\no7aX\r\n=4fgD\r\n-----END PGP SIGNATURE-----\r\n","size":2844,"noattachment":false,"key":"/@npmcli/promise-spawn/-/@npmcli/promise-spawn-1.3.1.tgz"},"gitHead":"df2d68d66e5d66895fe0a31cf047ce53cf3062c3","scripts":{"snap":"tap","test":"tap","preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags"},"_npmUser":{"name":"isaacs","email":"i@izs.me"},"repository":{"url":"git+https://github.com/npm/promise-spawn.git","type":"git"},"_npmVersion":"7.0.5","description":"spawn processes the way the npm cli likes to do","directories":{},"_nodeVersion":"14.14.0","dependencies":{"infer-owner":"^1.0.4"},"_hasShrinkwrap":false,"devDependencies":{"tap":"^14.10.6","minipass":"^3.1.1","require-inject":"^1.4.4"},"_npmOperationalInternal":{"tmp":"tmp/promise-spawn_1.3.1_1603822231602_0.5358633005460898","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":1603822231733,"_cnpm_publish_time":1603822231733,"dist-tags":{"latest":"10.0.1","latest-8":"8.0.4","latest-9":"9.0.2"}}