node-version-use 0.2.6 → 0.3.1
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/cli.js +1 -0
- package/lib/index.js +3 -3
- package/lib/use.js +6 -3
- package/package.json +9 -10
package/lib/cli.js
CHANGED
|
@@ -27,6 +27,7 @@ module.exports = function cli(argv, name) {
|
|
|
27
27
|
console.log('----------------------');
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
+
options.stdio = 'inherit'; // pass through stdio
|
|
30
31
|
nvs(args[0], args[1], args.slice(2), options, function (err, results) {
|
|
31
32
|
if (err) {
|
|
32
33
|
console.log(err.message);
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var use = require('./use');
|
|
2
|
-
var constants = require('./constants')
|
|
2
|
+
var constants = require('./constants');
|
|
3
3
|
|
|
4
4
|
module.exports = function nodeVersionUse(versionExpression, command, args, options, callback) {
|
|
5
5
|
if (typeof options === 'function') {
|
|
@@ -16,8 +16,8 @@ module.exports = function nodeVersionUse(versionExpression, command, args, optio
|
|
|
16
16
|
|
|
17
17
|
module.exports.installDirectory = function installDirectory() {
|
|
18
18
|
return constants.installDirectory;
|
|
19
|
-
}
|
|
19
|
+
};
|
|
20
20
|
|
|
21
21
|
module.exports.cacheDirectory = function cacheDirectory(options) {
|
|
22
22
|
return constants.cacheDirectory;
|
|
23
|
-
}
|
|
23
|
+
};
|
package/lib/use.js
CHANGED
|
@@ -5,15 +5,18 @@ var installRelease = require('node-install-release');
|
|
|
5
5
|
var versionUtils = require('node-version-utils');
|
|
6
6
|
var resolveVersions = require('node-resolve-versions');
|
|
7
7
|
|
|
8
|
-
var constants = require('./constants')
|
|
8
|
+
var constants = require('./constants');
|
|
9
|
+
var spawnKeys = ['encoding', 'stdio', 'stdin', 'stdout', 'stderr', 'cwd', 'env'];
|
|
9
10
|
|
|
10
11
|
module.exports = function use(versionExpression, command, args, options, callback) {
|
|
11
12
|
resolveVersions(versionExpression, assign({}, options, { path: 'raw' }), function (err, versions) {
|
|
12
13
|
if (err) return callback(err);
|
|
13
14
|
if (!versions.length) return callback(new Error('No versions found from expression: ' + versionExpression));
|
|
14
15
|
|
|
15
|
-
var spawnOptions =
|
|
16
|
-
|
|
16
|
+
var spawnOptions = {};
|
|
17
|
+
for (var i = 0; i < spawnKeys.length; i++) {
|
|
18
|
+
if (options[spawnKeys[i]] !== undefined) spawnOptions[spawnKeys[i]] = options[spawnKeys[i]];
|
|
19
|
+
}
|
|
17
20
|
|
|
18
21
|
var results = [];
|
|
19
22
|
var queue = new Queue(1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-version-use",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Cross-platform solution for using multiple versions of node. Useful for compatibility testing",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"node",
|
|
@@ -28,26 +28,25 @@
|
|
|
28
28
|
"compat": "./bin/node-version-use.js engines mocha-compat test/spec/**/*.test.js --no-timeouts",
|
|
29
29
|
"format": "prettier --write .",
|
|
30
30
|
"lint": "eslint .",
|
|
31
|
-
"prepublishOnly": "
|
|
31
|
+
"prepublishOnly": "npm run lint && depcheck",
|
|
32
32
|
"test": "mocha-compat test/spec/**/*.test.js --no-timeouts"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"cross-spawn-cb": "^0.
|
|
35
|
+
"cross-spawn-cb": "^0.6.4",
|
|
36
36
|
"exit": "^0.1.2",
|
|
37
37
|
"getopts-compat": "^2.2.5",
|
|
38
38
|
"just-extend": "^6.0.1",
|
|
39
|
-
"node-install-release": "^0.2
|
|
40
|
-
"node-resolve-versions": "^0.
|
|
41
|
-
"node-version-utils": "^0.
|
|
39
|
+
"node-install-release": "^0.3.2",
|
|
40
|
+
"node-resolve-versions": "^0.3.1",
|
|
41
|
+
"node-version-utils": "^0.5.1",
|
|
42
42
|
"osenv": "^0.1.5",
|
|
43
43
|
"queue-cb": "^1.1.6"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@typescript-eslint/parser": "^5.30.
|
|
46
|
+
"@typescript-eslint/parser": "^5.30.7",
|
|
47
47
|
"cr": "^0.1.0",
|
|
48
48
|
"depcheck": "^1.4.3",
|
|
49
|
-
"
|
|
50
|
-
"eslint": "^8.19.0",
|
|
49
|
+
"eslint": "^8.20.0",
|
|
51
50
|
"eslint-config-prettier": "^8.5.0",
|
|
52
51
|
"eslint-config-standard": "^17.0.0",
|
|
53
52
|
"eslint-plugin-import": "^2.26.0",
|
|
@@ -58,6 +57,6 @@
|
|
|
58
57
|
"rimraf": "^2.7.1"
|
|
59
58
|
},
|
|
60
59
|
"engines": {
|
|
61
|
-
"node": ">=0.
|
|
60
|
+
"node": ">=0.8"
|
|
62
61
|
}
|
|
63
62
|
}
|