{"id":17323970,"url":"https://github.com/strugee/node-smart-spawn","last_synced_at":"2026-01-20T03:11:46.331Z","repository":{"id":57363921,"uuid":"72316235","full_name":"strugee/node-smart-spawn","owner":"strugee","description":"Spawn an async process and get back stdout, handling errors","archived":false,"fork":false,"pushed_at":"2020-06-01T01:25:17.000Z","size":148,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-04T22:08:57.225Z","etag":null,"topics":["async-process","hacktoberfest","javascript","nodejs","process","spawned-processes","subprocess"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/smart-spawn","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/strugee.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-30T00:19:00.000Z","updated_at":"2021-10-07T17:21:05.000Z","dependencies_parsed_at":"2022-09-16T16:53:12.578Z","dependency_job_id":null,"html_url":"https://github.com/strugee/node-smart-spawn","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strugee%2Fnode-smart-spawn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strugee%2Fnode-smart-spawn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strugee%2Fnode-smart-spawn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strugee%2Fnode-smart-spawn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/strugee","download_url":"https://codeload.github.com/strugee/node-smart-spawn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247471397,"owners_count":20944154,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async-process","hacktoberfest","javascript","nodejs","process","spawned-processes","subprocess"],"created_at":"2024-10-15T14:09:43.144Z","updated_at":"2026-01-20T03:11:41.313Z","avatar_url":"https://github.com/strugee.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `smart-spawn`\n\n[![Build Status](https://travis-ci.org/strugee/node-smart-spawn.svg?branch=master)](http://travis-ci.org/strugee/node-smart-spawn)\n[![Coverage Status](https://coveralls.io/repos/github/strugee/node-smart-spawn/badge.svg?branch=master)](https://coveralls.io/github/strugee/node-smart-spawn?branch=master)\n[![npm](https://img.shields.io/npm/v/smart-spawn.svg)](https://npmjs.com/package/smart-spawn)\n[![Greenkeeper badge](https://badges.greenkeeper.io/strugee/node-smart-spawn.svg)](https://greenkeeper.io/)\n\nSpawn an async process and get back stdout, handling errors\n\n## Installation\n\n    npm install smart-spawn\n\n## Usage\n\nYou need Node 6+. It'll probably run on 0.10, 0.12 and 4 too, but the test suite doesn't cover those versions, so you're on your own. And you should upgrade anyway because those are horribly insecure.\n\n```js\nvar smartSpawn = require('smart-spawn');\n\nvar process = smartSpawn('ls', ['-l'], process.cwd(), function(err, stdout) {\n\tif (err) throw err;\n\n\tconsole.log(stdout);\n}\n```\n\n## Arguments\n\nArguments are, in order: the name of the process to spawn, arguments passed to the subprocess, the subprocess' working directory, and a callback function.\n\nThe callback receives two arguments. The first is an `Error` object which is passed if the process couldn't be spawned or if it exited with a nonzero exit code, otherwise it's `undefined`. The second is the process' stdout upon its completion (regardless of any errors that may have occured).\n\n## Return value\n\n`smart-spawn` will return an instance of [`ChildProcess`][1] representing the spawned subprocess.\n\n## License\n\nLGPL 3.0+\n\n## Author\n\nAJ Jordan \u003calex@strugee.net\u003e\n\n [1]: https://nodejs.org/api/child_process.html#child_process_class_childprocess\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrugee%2Fnode-smart-spawn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstrugee%2Fnode-smart-spawn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrugee%2Fnode-smart-spawn/lists"}