node-version-utils 0.4.4 → 0.5.2

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.
package/lib/index.js CHANGED
@@ -1,5 +1,4 @@
1
1
  module.exports = {
2
2
  spawn: require('./spawn'),
3
- spawnSync: require('./spawnSync'),
4
3
  spawnOptions: require('./spawnOptions')
5
4
  };
package/lib/spawn.js CHANGED
@@ -1,20 +1,17 @@
1
1
  var crossSpawn = require('cross-spawn-cb');
2
-
3
2
  var spawnOptions = require('./spawnOptions');
4
3
 
5
- function spawn(installPath, command, args, options, callback) {
6
- crossSpawn(command, args, spawnOptions(installPath, options), callback);
7
- }
8
-
9
- module.exports = function spawnWrapper(installPath, command, args, options, callback) {
4
+ module.exports = function spawn(installPath, command, args, options, callback) {
10
5
  if (typeof options === 'function') {
11
6
  callback = options;
12
7
  options = {};
13
8
  }
14
9
 
15
- if (typeof callback === 'function') return spawn(installPath, command, args, options || {}, callback);
10
+ if (typeof callback === 'function') {
11
+ return crossSpawn(command, args, spawnOptions(installPath, options || {}), callback);
12
+ }
16
13
  return new Promise(function (resolve, reject) {
17
- spawnWrapper(installPath, command, args, options, function spawnWrapperCallback(err, res) {
14
+ spawn(installPath, command, args, options, function spawnCallback(err, res) {
18
15
  err ? reject(err) : resolve(res);
19
16
  });
20
17
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-version-utils",
3
- "version": "0.4.4",
3
+ "version": "0.5.2",
4
4
  "description": "Utilities for running commands on a specific version of node by installed path",
5
5
  "keywords": [
6
6
  "node",
@@ -26,30 +26,31 @@
26
26
  "scripts": {
27
27
  "format": "prettier --write .",
28
28
  "lint": "eslint .",
29
- "prepublishOnly": "dtd \"npm run lint\" \"depcheck\"",
30
- "test": "mocha-compat test/spec/**/*.test.js --no-timeouts"
29
+ "prepublishOnly": "npm run lint && depcheck",
30
+ "test": "mocha-compat test/spec/**/*.test.js --no-timeouts",
31
+ "test:engines": "nvu engines npm test"
31
32
  },
32
33
  "dependencies": {
33
- "cross-spawn-cb": "^0.6.3",
34
+ "cross-spawn-cb": "^0.6.5",
34
35
  "env-path-key": "^0.3.0",
35
36
  "just-extend": "^6.0.1",
36
- "path-string-prepend": "^0.2.0"
37
+ "path-string-prepend": "^0.2.1",
38
+ "rimraf": "^2.7.1"
37
39
  },
38
40
  "devDependencies": {
39
41
  "@typescript-eslint/parser": "^5.30.7",
40
42
  "cr": "^0.1.0",
41
43
  "depcheck": "^1.4.3",
42
- "dis-dat": "^0.1.7",
43
44
  "eslint": "^8.20.0",
44
45
  "eslint-config-prettier": "^8.5.0",
45
46
  "eslint-config-standard": "^17.0.0",
46
47
  "eslint-plugin-import": "^2.26.0",
47
48
  "eslint-plugin-promise": "^6.0.0",
48
- "is-version": "^0.2.0",
49
+ "is-version": "^0.2.1",
49
50
  "lodash.find": "^4.6.0",
50
- "match-semver": "^0.1.0",
51
+ "match-semver": "^0.1.1",
51
52
  "mocha-compat": "^3.5.5",
52
- "node-install-release": "^0.2.8",
53
+ "node-install-release": "^0.3.4",
53
54
  "prettier": "^2.7.1",
54
55
  "semver": "^5.7.1"
55
56
  },
package/lib/spawnSync.js DELETED
@@ -1,6 +0,0 @@
1
- var crossSpawn = require('cross-spawn-cb');
2
- var spawnOptions = require('./spawnOptions');
3
-
4
- module.exports = function spawnSync(installPath, command, args, options) {
5
- return crossSpawn.sync(command, args, spawnOptions(installPath, options));
6
- };