├── .gitignore ├── LICENSE ├── README.md ├── SECURITY.md ├── index.js └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | lib-cov 2 | *.seed 3 | *.log 4 | *.csv 5 | *.dat 6 | *.out 7 | *.pid 8 | *.gz 9 | pids 10 | logs 11 | results 12 | npm-debug.log 13 | node_modules 14 | temp 15 | output.txt 16 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 Forbes Lindesay 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # spawn-sync 2 | 3 | This used to be a polyfill for `require('child_process').spawnSync` but now all actively maintained node versions already support `spawnSync`, so this is just a stub that re-exports `spawnSync`. 4 | 5 | ## Usage 6 | 7 | You should remove this library from your dependencies and just do: 8 | ```js 9 | var spawnSync = require('child_process').spawnSync; 10 | 11 | var result = spawnSync('node', 12 | ['filename.js'], 13 | {input: 'write this to stdin'}); 14 | 15 | if (result.status !== 0) { 16 | process.stderr.write(result.stderr); 17 | process.exit(result.status); 18 | } else { 19 | process.stdout.write(result.stdout); 20 | process.stderr.write(result.stderr); 21 | } 22 | ``` 23 | 24 | ## License 25 | 26 | MIT 27 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | ## Security contact information 2 | 3 | To report a security vulnerability, please use the 4 | [Tidelift security contact](https://tidelift.com/security). 5 | Tidelift will coordinate the fix and disclosure. 6 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = require('child_process').spawnSync; 4 | 5 | if (!module.exports) { 6 | throw new Error('spawnSync not supported by this version of node. Please upgrade to at least node@6'); 7 | } 8 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "spawn-sync", 3 | "version": "2.0.0", 4 | "description": "Exports child_process.spawnSync", 5 | "keywords": [], 6 | "dependencies": {}, 7 | "devDependencies": {}, 8 | "scripts": {}, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/ForbesLindesay/spawn-sync.git" 12 | }, 13 | "author": "ForbesLindesay", 14 | "license": "MIT" 15 | } --------------------------------------------------------------------------------