{"name":"spawno","version":"3.0.0","description":"Easily work with child processes.","type":"module","main":"lib/index.js","exports":"./lib/index.js","directories":{"example":"example"},"dependencies":{"proc-output":"^2.0.0"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Ionică Bizău","email":"bizauionica@gmail.com","url":"https://ionicabizau.net"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/IonicaBizau/spawno.git"},"keywords":["spawn","child","process"],"bugs":{"url":"https://github.com/IonicaBizau/spawno/issues"},"homepage":"https://github.com/IonicaBizau/spawno#readme","blah":{},"gitHead":"c94d5ddf73b8e58c6038d8af150f8271d0dd7fb2","_id":"spawno@3.0.0","_nodeVersion":"25.8.1","_npmVersion":"11.11.0","dist":{"integrity":"sha512-c0YVJjv4UkkceRcUoi2YI8U95+1aS8PoD+jDsmMV4Ec3SIFtaMscObPhfA3Swm9D/JjY5ooJfVSeJaV68OLj7A==","shasum":"d9a97058d50cc25ca77429946d5542db2ced6fac","tarball":"http://registry-npm.ywwl.com/spawno/download/spawno-3.0.0.tgz","fileCount":4,"unpackedSize":10197,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIACZlEEtrat6249mXrafHd1LlottyiW54gIReWHtcfmcAiByKSBGYcnhtJxh5nAzKPGLpB0MmHK4tzlKD2/d4LhvgQ=="}],"size":4112,"noattachment":false,"key":"/spawno/-/spawno-3.0.0.tgz"},"_npmUser":{"name":"ionicabizau","email":"bizauionica@gmail.com"},"maintainers":[{"name":"ionicabizau","email":"bizauionica@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/spawno_3.0.0_1779009917731_0.9542814157589847"},"_hasShrinkwrap":false,"readme":"<!-- Please do not edit this file. Edit the `blah` field in the `package.json` instead. If in doubt, open an issue. -->\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n# spawno\n\n [![Support me on Patreon][badge_patreon]][patreon] [![Buy me a book][badge_amazon]][amazon] [![PayPal][badge_paypal_donate]][paypal-donations] [![Ask me anything](https://img.shields.io/badge/ask%20me-anything-1abc9c.svg)](https://github.com/IonicaBizau/ama) [![Version](https://img.shields.io/npm/v/spawno.svg)](https://www.npmjs.com/package/spawno) [![Downloads](https://img.shields.io/npm/dt/spawno.svg)](https://www.npmjs.com/package/spawno) [![Get help on Codementor](https://cdn.codementor.io/badges/get_help_github.svg)](https://www.codementor.io/@johnnyb?utm_source=github&utm_medium=button&utm_term=johnnyb&utm_campaign=github)\n\n<a href=\"https://www.buymeacoffee.com/H96WwChMy\" target=\"_blank\"><img src=\"https://www.buymeacoffee.com/assets/img/custom_images/yellow_img.png\" alt=\"Buy Me A Coffee\"></a>\n\n\n\n\n\n\n\n> Easily work with child processes.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## :cloud: Installation\n\n```sh\n# Using npm\nnpm install --save spawno\n\n# Using yarn\nyarn add spawno\n```\n\n\n\n\n\n\n\n\n\n\n\n\n\n## :clipboard: Example\n\n\n\n```js\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport spawn from \"spawno\";\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\nspawn(\"ls\", [\"-l\"], { cwd: __dirname }, (err, stdout, stderr) => {\n    console.log(err || stderr || stdout);\n    // =>\n    // total 4\n    // -rw-rw-r-- 1 ionicabizau ionicabizau 256 Mar 27 14:53 index.js\n});\n\n// Pipe the output in the stdout/stderr streams (this will not collect the output in memory)\nspawn(\"ping\", [\"ionicabizau.net\"], {\n    cwd: __dirname,\n    output: true\n});\n\n// =>\n// PING ionicabizau.net (109.107.37.233) 56(84) bytes of data.\n// 64 bytes from cip-109-107-37-233.gb1.brightbox.com (109.107.37.233): icmp_seq=1 ttl=54 time=49.2 ms\n// 64 bytes from cip-109-107-37-233.gb1.brightbox.com (109.107.37.233): icmp_seq=2 ttl=54 time=44.4 ms\n// 64 bytes from cip-109-107-37-233.gb1.brightbox.com (109.107.37.233): icmp_seq=3 ttl=54 time=47.9 ms\n// 64 bytes from cip-109-107-37-233.gb1.brightbox.com (109.107.37.233): icmp_seq=4 ttl=54 time=46.3 ms\n\n// Promise interface\nspawn.promise(\"curl\", [\"ionicabizau.net\"]).then(console.log);\n```\n\n\n\n\n\n\n\n\n\n\n\n## :memo: Documentation\n\n\n### `spawno(command, args, options, cb)`\nCreates the child process.\n\n#### Params\n\n- **string** `command`: The command you want to run.\n- **Array** `args`: The command arguments.\n- **object** `options`: The options to pass to the `spawn` function extended with:\n - `output` (Boolean): If truly, the output will be piped in the\n   process stdout/stderr streams.\n - `data` (String|Boolean): If `false`, the `stdin` stream will not be ended. By default this is an empty string.\n- **Function** `cb`: The callback function.\n\n#### Return\n- **Process** The child process that was created.\n\n### `spawno.promise(command, args, options)`\nThe promise interface.\n\n#### Params\n\n- **string** `command`: The command you want to run.\n- **Array** `args`: The command arguments.\n- **object** `options`: The options to pass to the `spawn` function.\n\n#### Return\n- **Promise** The promise which will be eventually resolved with the following object:\n  - `code`\n  - `stdout`\n  - `stderr`\n\n\n\n\n\n\n\n\n\n## :question: Get Help\n\nThere are few ways to get help:\n\n\n\n 1. Please [post questions on Stack Overflow](https://stackoverflow.com/questions/ask). You can open issues with questions, as long you add a link to your Stack Overflow question.\n 2. For bug reports and feature requests, open issues. :bug:\n 3. For direct and quick help, you can [use Codementor](https://www.codementor.io/johnnyb). :rocket:\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## :yum: How to contribute\nHave an idea? Found a bug? See [how to contribute][contributing].\n\n\n## :sparkling_heart: Support my projects\nI open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously,\nthis takes time. You can integrate and use these projects in your applications *for free*! You can even change the source code and redistribute (even resell it).\n\nHowever, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:\n\n\n - Starring and sharing the projects you like :rocket:\n - [![Buy me a book][badge_amazon]][amazon]—I love books! I will remember you after years if you buy me one. :grin: :book:\n - [![PayPal][badge_paypal]][paypal-donations]—You can make one-time donations via PayPal. I'll probably buy a ~~coffee~~ tea. :tea:\n - [![Support me on Patreon][badge_patreon]][patreon]—Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone).\n - **Bitcoin**—You can send me bitcoins at this address (or scanning the code below): `1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6`\n\n    ![](https://i.imgur.com/z6OQI95.png)\n\n\nThanks! :heart:\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## :scroll: License\n\n[MIT][license] © [Ionică Bizău][website]\n\n\n\n\n\n\n[license]: /LICENSE\n[website]: https://ionicabizau.net\n[contributing]: /CONTRIBUTING.md\n[docs]: /DOCUMENTATION.md\n[badge_patreon]: https://ionicabizau.github.io/badges/patreon.svg\n[badge_amazon]: https://ionicabizau.github.io/badges/amazon.svg\n[badge_paypal]: https://ionicabizau.github.io/badges/paypal.svg\n[badge_paypal_donate]: https://ionicabizau.github.io/badges/paypal_donate.svg\n[patreon]: https://www.patreon.com/ionicabizau\n[amazon]: http://amzn.eu/hRo9sIZ\n[paypal-donations]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RVXDDLKKLQRJW\n","publish_time":1779009917867,"_cnpm_publish_time":1779009917867,"dist-tags":{"latest":"3.0.0"}}