cross-spawn-cb 0.6.4 → 0.6.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,9 @@
1
+ require('./polyfills');
1
2
  var once = require('once');
2
3
  var nextTick = require('next-tick');
4
+ var constants = require('./constants');
3
5
 
4
- var major = +process.versions.node.split('.')[0];
5
- var spawn = major < 8 ? require('./cross-spawn-3.0.1').spawn : require('cross-spawn').spawn;
6
+ var spawn = require('./cross-spawn').spawn;
6
7
 
7
8
  module.exports = function spawnCallback(command, args, options, callback) {
8
9
  if (typeof options === 'function') {
@@ -47,13 +48,14 @@ module.exports = function spawnCallback(command, args, options, callback) {
47
48
  res.stderr = Buffer.concat(res.stderr);
48
49
  if (options.encoding !== 'buffer') res.stderr = res.stderr.toString(options.encoding);
49
50
  }
50
- res.stdio = [null, res.stdout, res.stderr];
51
+ res.output = [null, res.stdout, res.stderr];
51
52
 
52
53
  // process errors
53
54
  var err = res.status !== 0 ? new Error('Non-zero exit code: ' + res.status) : null;
54
55
  if (res.stderr && res.stderr.length) {
55
56
  err = err || new Error('stderr has content');
56
57
  for (var key in res) {
58
+ if (constants.spawnKeys.indexOf(key) < 0) continue;
57
59
  err[key] = Buffer.isBuffer(res[key]) ? res[key].toString('utf8') : res[key];
58
60
  }
59
61
  }
@@ -1,7 +1,7 @@
1
1
  var assign = require('just-extend');
2
+ var constants = require('./constants');
2
3
 
3
- var major = +process.versions.node.split('.')[0];
4
- var spawnSync = major < 8 ? require('./cross-spawn-3.0.1').sync : require('cross-spawn').sync;
4
+ var spawnSync = require('./cross-spawn').sync;
5
5
 
6
6
  module.exports = function spawnSyncCallback(command, args, options) {
7
7
  options = options || {};
@@ -28,6 +28,7 @@ module.exports = function spawnSyncCallback(command, args, options) {
28
28
  if (res.stderr && res.stderr.length) {
29
29
  err = err || new Error('stderr has content');
30
30
  for (var key in res) {
31
+ if (constants.spawnKeys.indexOf(key) < 0) continue;
31
32
  err[key] = Buffer.isBuffer(res[key]) ? res[key].toString('utf8') : res[key];
32
33
  }
33
34
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cross-spawn-cb",
3
- "version": "0.6.4",
3
+ "version": "0.6.7",
4
4
  "description": "Cross spawn with a completion callback",
5
5
  "keywords": [
6
6
  "cross-spawn",
@@ -13,41 +13,53 @@
13
13
  },
14
14
  "license": "MIT",
15
15
  "main": "lib/index.js",
16
+ "files": [
17
+ "lib"
18
+ ],
16
19
  "scripts": {
20
+ "build": "",
21
+ "build:spawn": "rollup -c config/rollup.cs.config.js",
17
22
  "format": "prettier --write .",
18
23
  "lint": "eslint .",
19
24
  "prepublishOnly": "npm run lint && depcheck",
20
- "test": "mocha-compat test/spec/**/*.test.js",
21
- "build": "rollup -c config/rollup.cs.config.js"
25
+ "test": "mocha-compat test/spec/**/*.test.js --no-timeouts",
26
+ "test:engines": "nvu engines npm test"
22
27
  },
23
- "files": [
24
- "lib"
25
- ],
26
28
  "dependencies": {
29
+ "buffer-v6-polyfill": "^1.0.5",
30
+ "core-js": "^3.24.0",
27
31
  "cross-spawn": "^7.0.3",
28
- "function-exec-sync": "^0.2.1",
32
+ "function-exec-sync": "^0.2.4",
29
33
  "just-extend": "^6.0.1",
30
34
  "next-tick": "^1.1.0",
31
35
  "once": "^1.4.0"
32
36
  },
33
37
  "devDependencies": {
34
- "@babel/preset-env": "^7.18.6",
38
+ "@babel/preset-env": "^7.18.9",
35
39
  "@rollup/plugin-babel": "^5.3.1",
36
40
  "@rollup/plugin-commonjs": "^22.0.1",
37
41
  "@rollup/plugin-node-resolve": "^13.3.0",
38
- "@typescript-eslint/parser": "^5.30.6",
42
+ "@typescript-eslint/parser": "^5.30.7",
43
+ "cr": "^0.1.0",
44
+ "cross-spawn-cb": "^0.6.6",
39
45
  "depcheck": "^1.4.3",
40
- "eslint": "^8.19.0",
46
+ "eslint": "^8.20.0",
41
47
  "eslint-config-prettier": "^8.5.0",
42
48
  "eslint-config-standard": "^17.0.0",
43
49
  "eslint-plugin-import": "^2.26.0",
44
50
  "eslint-plugin-promise": "^6.0.0",
51
+ "is-version": "^0.2.1",
52
+ "lodash.find": "^4.6.0",
53
+ "match-semver": "^0.1.1",
45
54
  "mocha-compat": "^3.5.5",
55
+ "node-install-release": "^0.3.6",
56
+ "node-version-utils": "^0.5.3",
46
57
  "prettier": "^2.7.1",
47
- "rollup": "^2.76.0",
58
+ "rollup": "^2.77.0",
48
59
  "rollup-plugin-babel": "^4.4.0",
49
60
  "rollup-plugin-commonjs": "^10.1.0",
50
- "rollup-plugin-node-externals": "^4.1.1"
61
+ "rollup-plugin-node-externals": "^4.1.1",
62
+ "semver": "^5.7.1"
51
63
  },
52
64
  "engines": {
53
65
  "node": ">=0.8"