{"name":"gulp-execa","version":"8.0.1","type":"module","exports":{"types":"./build/src/main.d.ts","default":"./build/src/main.js"},"main":"./build/src/main.js","types":"./build/src/main.d.ts","sideEffects":false,"scripts":{"test":"gulp test"},"description":"Gulp.js command execution for humans","keywords":["gulp","execa","gulp-plugin","gulpjs","gulpplugin","bash","cli","typescript","es6","javascript","library","nodejs","shell","terminal","command-line","child-process","exec","stream","security","spawn"],"license":"Apache-2.0","homepage":"https://www.github.com/ehmicky/gulp-execa","repository":{"type":"git","url":"git+https://github.com/ehmicky/gulp-execa.git"},"bugs":{"url":"https://github.com/ehmicky/gulp-execa/issues"},"author":{"name":"ehmicky","email":"ehmicky@gmail.com","url":"https://github.com/ehmicky"},"directories":{"lib":"src"},"dependencies":{"@types/vinyl":"^2.0.12","colors-option":"^6.0.1","execa":"^9.5.2","fancy-log":"^2.0.0","filter-obj":"^6.1.0","is-plain-obj":"^4.1.0","jest-validate":"^29.7.0","plugin-error":"^2.0.1","rename-fn":"^2.1.0","through2-concurrent":"^2.0.0"},"devDependencies":{"@ehmicky/dev-tasks":"^3.0.33","@ehmicky/eslint-config":"^20.0.31","@ehmicky/prettier-config":"^1.0.6","@types/node":"^22.13.14","gulp":"^5.0.0","raw-body":"^3.0.0","test-each":"^7.0.1"},"engines":{"node":">=18.18.0"},"_id":"gulp-execa@8.0.1","gitHead":"cc0fadd6677769e6f3fc781d7312791ab37d0b87","_nodeVersion":"23.10.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-SFnmbpH0Ki+RvNckjSEZjJEtvhE0dJkVAqmtK8rHQCkyWEKEy6cFFMnArIZJWPcjJliaUU1yhnAIXyyIoTKZsA==","shasum":"c70f971b79bf8e695b4bb535fa0d00bd89ef75d1","tarball":"http://registry-npm.ywwl.com/gulp-execa/download/gulp-execa-8.0.1.tgz","fileCount":16,"unpackedSize":35133,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDNDhO46QFkPzdZISKhyN/1PoF0TjKFomGGsRLFECRYrgIgdTFl28wrBn5XWDof+466ww3MRZl1sgbN63N2qzWJ1zA="}],"size":11600,"noattachment":false,"key":"/gulp-execa/-/gulp-execa-8.0.1.tgz"},"_npmUser":{"name":"ehmicky","email":"ehmicky@gmail.com"},"maintainers":[{"name":"ehmicky","email":"ehmicky@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/gulp-execa_8.0.1_1743216564668_0.012223785494658745"},"_hasShrinkwrap":false,"readme":"<picture>\n  <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/ehmicky/design/main/gulp-execa/gulp-execa_dark.svg\"/>\n  <img alt=\"gulp-execa logo\" src=\"https://raw.githubusercontent.com/ehmicky/design/main/gulp-execa/gulp-execa.svg\" width=\"500\"/>\n</picture>\n\n[![Node](https://img.shields.io/badge/-Node.js-808080?logo=node.js&colorA=404040&logoColor=66cc33)](https://www.npmjs.com/package/gulp-execa)\n[![TypeScript](https://img.shields.io/badge/-Typed-808080?logo=typescript&colorA=404040&logoColor=0096ff)](/src/main.d.ts)\n[![Codecov](https://img.shields.io/badge/-Tested%20100%25-808080?logo=codecov&colorA=404040)](https://codecov.io/gh/ehmicky/gulp-execa)\n[![Mastodon](https://img.shields.io/badge/-Mastodon-808080.svg?logo=mastodon&colorA=404040&logoColor=9590F9)](https://fosstodon.org/@ehmicky)\n[![Medium](https://img.shields.io/badge/-Medium-808080.svg?logo=medium&colorA=404040)](https://medium.com/@ehmicky)\n\n[Gulp.js](https://gulpjs.com) command execution for humans.\n\nAs opposed to similar plugins or to\n[`child_process.exec()`](https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback),\nthis uses [Execa](https://github.com/sindresorhus/execa) which provides:\n\n- [Better Windows support](https://github.com/IndigoUnited/node-cross-spawn#why),\n  including [shebangs](<https://en.wikipedia.org/wiki/Shebang_(Unix)>)\n- Faster and more secure commands, since [no shell is used by default](#command)\n- Execution of\n  [locally installed binaries](https://github.com/sindresorhus/execa#preferlocal)\n- [Interleaved](https://github.com/sindresorhus/execa#all-1) `stdout`/`stderr`\n\n`gulp-execa` adds Gulp-specific features to\n[Execa](https://github.com/sindresorhus/execa) including:\n\n- a [task shortcut syntax](#taskcommand-options)\n- configurable [verbosity](#echo)\n- [better errors](https://github.com/gulpjs/plugin-error)\n\nCommands can be executed either directly or inside a\n[files stream](https://gulpjs.com/docs/en/api/src). In\n[streaming mode](#streamfunction-options), unlike other libraries:\n\n- commands are run [in parallel](https://github.com/almost/through2-concurrent),\n  not [serially](https://github.com/rvagg/through2)\n- output can be saved [either in files or in variables](#result)\n\n# Example\n\n`gulpfile.js`:\n\n```js\nimport { pipeline } from 'node:stream/promises'\n\nimport gulp from 'gulp'\nimport { exec, stream, task } from 'gulp-execa'\n\nexport const audit = task('npm audit')\n\nexport const outdated = async () => {\n  await exec('npm outdated')\n}\n\nexport const sort = () =>\n  pipeline(\n    gulp.src('*.txt'),\n    stream(({ path }) => `sort ${path}`),\n    gulp.dest('sorted'),\n  )\n```\n\n# Install\n\n```\nnpm install -D gulp-execa\n```\n\nThis plugin requires Gulp 5 and Node.js >=18.18.0. It is an ES module and must\nbe loaded using\n[an `import` or `import()` statement](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c),\nnot `require()`. If TypeScript is used, it must be configured to\n[output ES modules](https://www.typescriptlang.org/docs/handbook/esm-node.html),\nnot CommonJS.\n\n# Methods\n\n## task(command, [options])\n\nReturns a Gulp task that executes `command`.\n\n```js\nimport { task } from 'gulp-execa'\n\nexport const audit = task('npm audit')\n```\n\n## exec(command, [options])\n\nExecutes `command`. The return value is both a promise and a\n[`child_process` instance](https://github.com/sindresorhus/execa#execacommand-options).\n\nThe promise will be resolved with the\n[command result](https://github.com/sindresorhus/execa#childprocessresult). If\nthe command failed, the promise will be rejected with a nice\n[error](https://github.com/sindresorhus/execa#childprocessresult). If the\n[`reject: false`](https://github.com/sindresorhus/execa#reject) option was used,\nthe promise will be resolved with that error instead.\n\n```js\nimport { exec } from 'gulp-execa'\n\nexport const outdated = async () => {\n  await exec('npm outdated')\n}\n```\n\n## stream(function, [options])\n\nReturns a stream that executes a `command` on each input file.\n\n`function` must:\n\n- take a [Vinyl file](https://gulpjs.com/docs/en/api/vinyl#instance-properties)\n  as argument. The most useful property is `file.path` but\n  [other properties](https://gulpjs.com/docs/en/api/vinyl#instance-properties)\n  are available as well.\n- return either:\n  - a `command` string\n  - an `options` object with a `command` property\n  - `undefined`\n\n```js\nimport { pipeline } from 'node:stream/promises'\n\nimport gulp from 'gulp'\nimport { stream } from 'gulp-execa'\n\nexport const sort = () =>\n  pipeline(\n    gulp.src('*.txt'),\n    stream(({ path }) => `sort ${path}`),\n    gulp.dest('sorted'),\n  )\n```\n\nEach file in the stream will spawn a separate process. This can consume lots of\nresources so you should only use this method when there are no alternatives such\nas:\n\n- firing a command programmatically instead of spawning a child process\n- passing several files, a directory or a globbing pattern as arguments to the\n  command\n\nThe [`debug`](#debug),\n[`stdout`](https://github.com/sindresorhus/execa#stdout-1),\n[`stderr`](https://github.com/sindresorhus/execa#stderr-1),\n[`all`](https://github.com/sindresorhus/execa#all-2) and\n[`stdio`](https://github.com/sindresorhus/execa#stdio) options cannot be used\nwith this method.\n\n# Command\n\nBy default no shell interpreter (like Bash or `cmd.exe`) is used. This means\n`command` must be just the program and its arguments. No escaping/quoting is\nneeded, except for significant spaces (with a backslash).\n\nShell features such as globbing, variables and operators (like `&&` `>` `;`)\nshould not be used. All of this can be done directly in Node.js instead.\n\nShell interpreters are slower, less secure and less cross-platform. However, you\ncan still opt-in to using them with the\n[`shell` option](https://github.com/sindresorhus/execa#shell).\n\n```js\nimport { writeFileStream } from 'node:fs'\n\nimport gulp from 'gulp'\nimport { task } from 'gulp-execa'\n\n// Wrong\n// export const check = task('npm audit && npm outdated')\n\n// Correct\nexport const check = gulp.series(task('npm audit'), task('npm outdated'))\n\n// Wrong\n// export const install = task('npm install > log.txt')\n\n// Correct\nexport const install = task('npm install', {\n  stdout: writeFileStream('log.txt'),\n})\n```\n\n# Options\n\n`options` is an optional object.\n\n[All Execa options](https://github.com/sindresorhus/execa#options) can be used.\nPlease refer to its documentation for a list of possible options.\n\nThe following options are available as well.\n\n## echo\n\n_Type_: `boolean`\\\n_Default_: [`debug`](#debug) option's value\n\nWhether the `command` should be printed on the console.\n\n```bash\n$ gulp audit\n[13:09:39] Using gulpfile ~/code/gulpfile.js\n[13:09:39] Starting 'audit'...\n[13:09:39] [gulp-execa] npm audit\n[13:09:44] Finished 'audit' after 4.96 s\n```\n\n## debug\n\n_Type_: `boolean`\\\n_Default_: `true` for [`task()`](#taskcommand-options) and\n[`exec()`](#execcommand-options), `false` for\n[`stream()`](#streamfunction-options).\n\nWhether both the `command` and its output (`stdout`/`stderr`) should be printed\non the console instead of being returned in JavaScript.\n\n```bash\n$ gulp audit\n[13:09:39] Using gulpfile ~/code/gulpfile.js\n[13:09:39] Starting 'audit'...\n[13:09:39] [gulp-execa] npm audit\n\n                        == npm audit security report ===\n\nfound 0 vulnerabilities\n in 27282 scanned packages\n[13:09:44] Finished 'audit' after 4.96 s\n```\n\n## result\n\n_Type_: `string`\\\n_Value_: `'replace'` or `'save'`\\\n_Default_: `'replace'`\n\nWith [`stream()`](#streamfunction-options), whether the command result should:\n\n- `replace` the file's contents\n- `save`: [be pushed](https://github.com/sindresorhus/execa#childprocessresult)\n  to the `file.execa` array property\n\n<!-- eslint-disable unicorn/no-null -->\n\n```js\nimport { pipeline } from 'node:stream/promises'\n\nimport gulp from 'gulp'\nimport { stream } from 'gulp-execa'\nimport through from 'through2'\n\nexport const task = () =>\n  pipeline(\n    gulp.src('*.js'),\n    // Prints the number of lines of each file\n    stream(({ path }) => `wc -l ${path}`, { result: 'save' }),\n    through.obj((file, encoding, func) => {\n      console.log(file.execa[0].stdout)\n      func(null, file)\n    }),\n  )\n```\n\n## from\n\n_Type_: `string`\\\n_Value_: `'stdout'`, `'stderr'` or `'all'`\\\n_Default_: `'stdout'`\n\nWhich output stream to use with [`result: 'replace'`](#result).\n\n<!-- eslint-disable unicorn/no-null -->\n\n```js\nimport { pipeline } from 'node:stream/promises'\n\nimport gulp from 'gulp'\nimport { stream } from 'gulp-execa'\nimport through from 'through2'\n\nexport const task = () =>\n  pipeline(\n    gulp.src('*.js'),\n    // Prints the number of lines of each file, including `stderr`\n    stream(({ path }) => `wc -l ${path}`, { result: 'replace', from: 'all' }),\n    through.obj((file, encoding, func) => {\n      console.log(file.contents.toString())\n      func(null, file)\n    }),\n  )\n```\n\n## maxConcurrency\n\n_Type_: `integer`\\\n_Default_: `100`\n\nWith [`stream()`](#streamfunction-options), how many commands to run in parallel\nat once.\n\n# See also\n\n- [Execa](https://github.com/sindresorhus/execa)\n\n# Support\n\nFor any question, _don't hesitate_ to [submit an issue on GitHub](../../issues).\n\nEveryone is welcome regardless of personal background. We enforce a\n[Code of conduct](CODE_OF_CONDUCT.md) in order to promote a positive and\ninclusive environment.\n\n# Contributing\n\nThis project was made with ❤️. The simplest way to give back is by starring and\nsharing it online.\n\nIf the documentation is unclear or has a typo, please click on the page's `Edit`\nbutton (pencil icon) and suggest a correction.\n\nIf you would like to help us fix a bug or add a new feature, please check our\n[guidelines](CONTRIBUTING.md). Pull requests are welcome!\n\nThanks go to our wonderful contributors:\n\n<!-- ALL-CONTRIBUTORS-LIST:START -->\n<!-- prettier-ignore -->\n<table><tr><td align=\"center\"><a href=\"https://fosstodon.org/@ehmicky\"><img src=\"https://avatars2.githubusercontent.com/u/8136211?v=4\" width=\"100px;\" alt=\"ehmicky\"/><br /><sub><b>ehmicky</b></sub></a><br /><a href=\"https://github.com/ehmicky/gulp-execa/commits?author=ehmicky\" title=\"Code\">💻</a> <a href=\"#design-ehmicky\" title=\"Design\">🎨</a> <a href=\"#ideas-ehmicky\" title=\"Ideas, Planning, & Feedback\">🤔</a> <a href=\"https://github.com/ehmicky/gulp-execa/commits?author=ehmicky\" title=\"Documentation\">📖</a></td><td align=\"center\"><a href=\"https://twitter.com/BarryThePenguin\"><img src=\"https://avatars3.githubusercontent.com/u/1351912?v=4\" width=\"100px;\" alt=\"Jonathan Haines\"/><br /><sub><b>Jonathan Haines</b></sub></a><br /><a href=\"https://github.com/ehmicky/gulp-execa/issues?q=author%3ABarryThePenguin\" title=\"Bug reports\">🐛</a></td></tr></table>\n\n<!-- ALL-CONTRIBUTORS-LIST:END -->\n","publish_time":1743216564890,"_cnpm_publish_time":1743216564890,"dist-tags":{"latest":"8.0.1"}}