Require Node.js 6
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Sindre Sorhus · committed by Sindre Sorhus · parent 7488ce9 · Browse files · 9 files·+116 added−116 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
9 files+116 added−116 removed
- other:+116 added−116 removed
Provenance
- Commit
49518e1- Tree
9b85774- Author
Sindre Sorhus <sindresorhus@gmail.com>- Committer
Sindre Sorhus <sindresorhus@gmail.com>- Parent
7488ce9
9 files changed+116 added−116 removed
modified:lib/errname.js+1 added-1 removed
122345633 unmodified lines'use strict';// Older verions of Node might not have `util.getSystemErrorName()`.// Older verions of Node.js might not have `util.getSystemErrorName()`.// In that case, fall back to a deprecated internal.const util = require('util');
let uv;33 unmodified linesmodified:.gitattributes+1 added-2 removed
1-* text=auto2-*.js text eol=lf1+* text=auto eol=lfmodified:.gitignore+1 added
1 node_modules2+yarn.lock3 .nyc_output4 coverageadded:.npmrc+1 added
1+package-lock=falsemodified:.travis.yml+1 added-3 removed
1234556767language: node_jsnode_js: - '10' - '8' - '6' - '4'before_install: - npm install --global npm@3after_script: - 'cat coverage/lcov.info | ./node_modules/.bin/coveralls'modified:appveyor.yml+1 added-1 removed
123455678911 unmodified linesenvironment: matrix: - nodejs_version: '10' - nodejs_version: '8' - nodejs_version: '6' - nodejs_version: '4'install: - ps: Install-Product node $env:nodejs_version - npm install --global npm@latest - set PATH=%APPDATA%\npm;%PATH%11 unmodified linesmodified:index.js+4 added-8 removed
306 unmodified lines307 308 return spawned;309 };310 311-module.exports.stdout = function (...args) {312- // TODO: set `stderr: 'ignore'` when that option is implemented313- return module.exports(...args).then(x => x.stdout);311+// TODO: set `stderr: 'ignore'` when that option is implemented312+module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout);314-};313 316-module.exports.stderr = function (...args) {317- // TODO: set `stdout: 'ignore'` when that option is implemented318- return module.exports(...args).then(x => x.stderr);314+// TODO: set `stdout: 'ignore'` when that option is implemented315+module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr);319-};316 317 module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts);318 319 module.exports.sync = (cmd, args, opts) => {37 unmodified linesmodified:package.json+67 added-74 removed
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747523456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869{ "name": "execa", "version": "0.10.0", "description": "A better `child_process`", "license": "MIT", "repository": "sindresorhus/execa", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "maintainers": [ { "name": "James Talmage", "email": "james@talmage.io", "url": "github.com/jamestalmage" } ], "engines": { "node": ">=4" }, "scripts": { "test": "xo && nyc ava" }, "files": [ "index.js", "lib" ], "keywords": [ "exec", "child", "process", "execute", "fork", "execfile", "spawn", "file", "shell", "bin", "binary", "binaries", "npm", "path", "local" ], "dependencies": { "cross-spawn": "^6.0.0", "get-stream": "^3.0.0", "is-stream": "^1.1.0", "npm-run-path": "^2.0.0", "p-finally": "^1.0.0", "signal-exit": "^3.0.0", "strip-eof": "^1.0.0" }, "devDependencies": { "ava": "*", "cat-names": "^1.0.2", "coveralls": "^2.11.9", "delay": "^2.0.0", "is-running": "^2.0.0", "nyc": "^11.0.2", "tempfile": "^2.0.0", "xo": "*" }, "nyc": { "reporter": [ "text", "lcov" ], "exclude": [ "**/fixtures/**", "**/test.js", "**/test/**" ] } "name": "execa", "version": "0.10.0", "description": "A better `child_process`", "license": "MIT", "repository": "sindresorhus/execa", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=6" }, "scripts": { "test": "xo && nyc ava" }, "files": [ "index.js", "lib" ], "keywords": [ "exec", "child", "process", "execute", "fork", "execfile", "spawn", "file", "shell", "bin", "binary", "binaries", "npm", "path", "local" ], "dependencies": { "cross-spawn": "^6.0.0", "get-stream": "^3.0.0", "is-stream": "^1.1.0", "npm-run-path": "^2.0.0", "p-finally": "^1.0.0", "signal-exit": "^3.0.0", "strip-eof": "^1.0.0" }, "devDependencies": { "ava": "*", "cat-names": "^1.0.2", "coveralls": "^3.0.1", "delay": "^3.0.0", "is-running": "^2.0.0", "nyc": "^12.0.2", "tempfile": "^2.0.0", "xo": "*" }, "nyc": { "reporter": [ "text", "lcov" ], "exclude": [ "**/fixtures/**", "**/test.js", "**/test/**" ] }}modified:readme.md+39 added-27 removed
28 unmodified lines29 30 ```js31 const execa = require('execa');32 33-execa('echo', ['unicorns']).then(result => {34- console.log(result.stdout);33+(async () => {34+ const {stdout} = await execa('echo', ['unicorns']);35+ console.log(stdout);36 //=> 'unicorns'36-});37+})();38+```39 38-// pipe the child process stdout to the current stdout39-execa('echo', ['unicorns']).stdout.pipe(process.stdout);40+Additional examples:41 41-execa.shell('echo unicorns').then(result => {42- console.log(result.stdout);42+```js43+const execa = require('execa');44+45+(async () => {46+ // Pipe the child process stdout to the current stdout47+ execa('echo', ['unicorns']).stdout.pipe(process.stdout);48+49+50+ // Run a shell command51+ const {stdout} = await execa.shell('echo unicorns');52 //=> 'unicorns'44-});53 54+55+ // Catching an error56+ try {46-// example of catching an error47-execa.shell('exit 3').catch(error => {48- console.log(error);49- /*50- {51- message: 'Command failed: /bin/sh -c exit 3'52- killed: false,53- code: 3,54- signal: null,55- cmd: '/bin/sh -c exit 3',56- stdout: '',57- stderr: '',58- timedOut: false57+ await execa.shell('exit 3');58+ } catch (error) {59+ console.log(error);60+ /*61+ {62+ message: 'Command failed: /bin/sh -c exit 3'63+ killed: false,64+ code: 3,65+ signal: null,66+ cmd: '/bin/sh -c exit 3',67+ stdout: '',68+ stderr: '',69+ timedOut: false70+ }71+ */72 }60- */61-});73+})();74 63-// example of catching an error with a sync method75+// Catching an error with a sync method76 try {77 execa.shellSync('exit 3');66-} catch (err) {67- console.log(err);78+} catch (error) {79+ console.log(error);80 /*81 {82 message: 'Command failed: /bin/sh -c exit 3'83 code: 3,80 unmodified lines164 Explicitly set the value of `argv[0]` sent to the child process. This will be set to `command` or `file` if not specified.165 166 #### stdio167 156-Type: `Array` `string`<br>168+Type: `string[]` `string`<br>169 Default: `pipe`170 171 Child's [stdio](https://nodejs.org/api/child_process.html#child_process_options_stdio) configuration.172 148 unmodified lines