node-version-utils 1.0.0 → 1.0.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/dist/cjs/index.js
CHANGED
|
@@ -28,4 +28,4 @@ function _interop_require_default(obj) {
|
|
|
28
28
|
default: obj
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
-
/* CJS INTEROP */ if (exports.__esModule && exports.default) { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) exports.default[key] = exports[key]; module.exports = exports.default; }
|
|
31
|
+
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) { exports.default[key] = exports[key]; } } catch (_) {}; module.exports = exports.default; }
|
package/dist/cjs/polyfills.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
require('core-js/actual/promise');
|
|
3
|
-
/* CJS INTEROP */ if (exports.__esModule && exports.default) { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) exports.default[key] = exports[key]; module.exports = exports.default; }
|
|
3
|
+
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) { exports.default[key] = exports[key]; } } catch (_) {}; module.exports = exports.default; }
|
package/dist/cjs/spawn.js
CHANGED
|
@@ -15,4 +15,4 @@ module.exports = function spawn(installPath, command, args, options, callback) {
|
|
|
15
15
|
});
|
|
16
16
|
});
|
|
17
17
|
};
|
|
18
|
-
/* CJS INTEROP */ if (exports.__esModule && exports.default) { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) exports.default[key] = exports[key]; module.exports = exports.default; }
|
|
18
|
+
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) { exports.default[key] = exports[key]; } } catch (_) {}; module.exports = exports.default; }
|
package/dist/cjs/spawnOptions.js
CHANGED
|
@@ -53,10 +53,10 @@ function _object_spread_props(target, source) {
|
|
|
53
53
|
}
|
|
54
54
|
var path = require('path');
|
|
55
55
|
var prepend = require('path-string-prepend');
|
|
56
|
-
var NODE = process.platform === 'win32' ? 'node.exe' : 'node';
|
|
57
56
|
var pathKey = require('env-path-key');
|
|
58
57
|
var startsCaseInsensitiveFn = require('./startsCaseInsensitiveFn');
|
|
59
|
-
var isWindows = process.platform === 'win32';
|
|
58
|
+
var isWindows = process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE);
|
|
59
|
+
var NODE = isWindows ? 'node.exe' : 'node';
|
|
60
60
|
var startsNPM = startsCaseInsensitiveFn('npm_');
|
|
61
61
|
var startsPath = startsCaseInsensitiveFn('path');
|
|
62
62
|
module.exports = function spawnOptions(installPath, options) {
|
|
@@ -85,4 +85,4 @@ module.exports = function spawnOptions(installPath, options) {
|
|
|
85
85
|
env: env
|
|
86
86
|
});
|
|
87
87
|
};
|
|
88
|
-
/* CJS INTEROP */ if (exports.__esModule && exports.default) { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) exports.default[key] = exports[key]; module.exports = exports.default; }
|
|
88
|
+
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) { exports.default[key] = exports[key]; } } catch (_) {}; module.exports = exports.default; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["spawnOptions.js"],"sourcesContent":["const path = require('path');\nconst prepend = require('path-string-prepend');\nconst
|
|
1
|
+
{"version":3,"sources":["spawnOptions.js"],"sourcesContent":["const path = require('path');\nconst prepend = require('path-string-prepend');\nconst pathKey = require('env-path-key');\nconst startsCaseInsensitiveFn = require('./startsCaseInsensitiveFn');\n\nconst isWindows = process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE);\nconst NODE = isWindows ? 'node.exe' : 'node';\n\nconst startsNPM = startsCaseInsensitiveFn('npm_');\nconst startsPath = startsCaseInsensitiveFn('path');\n\nmodule.exports = function spawnOptions(installPath, options) {\n const PATH_KEY = pathKey();\n const processEnv = process.env;\n const env = {};\n env.npm_config_binroot = isWindows ? installPath : path.join(installPath, 'bin');\n env.npm_config_root = isWindows ? installPath : path.join(installPath, 'lib');\n env.npm_config_man = isWindows ? installPath : path.join(installPath, 'man');\n env.npm_config_prefix = installPath;\n env.npm_node_execpath = path.join(env.npm_config_binroot, NODE);\n\n // copy the environment not for npm and skip case-insesitive additional paths\n for (const key in processEnv) {\n // skip npm_ variants and non-matching path\n if (key.length > 4 && startsNPM(key)) continue;\n if (key.length === 4 && startsPath(key) && key !== PATH_KEY) continue;\n env[key] = processEnv[key];\n }\n\n // override node\n if (env.NODE !== undefined) env.NODE = env.npm_node_execpath;\n if (env.NODE_EXE !== undefined) env.NODE_EXE = env.npm_node_execpath;\n\n // put the path to node and npm at the front and remove nvs\n env[PATH_KEY] = prepend(env[PATH_KEY] || '', env.npm_config_binroot);\n return { ...options, cwd: process.cwd(), env };\n};\n"],"names":["path","require","prepend","pathKey","startsCaseInsensitiveFn","isWindows","process","platform","test","env","OSTYPE","NODE","startsNPM","startsPath","module","exports","spawnOptions","installPath","options","PATH_KEY","processEnv","npm_config_binroot","join","npm_config_root","npm_config_man","npm_config_prefix","npm_node_execpath","key","length","undefined","NODE_EXE","cwd"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAMA,OAAOC,QAAQ;AACrB,IAAMC,UAAUD,QAAQ;AACxB,IAAME,UAAUF,QAAQ;AACxB,IAAMG,0BAA0BH,QAAQ;AAExC,IAAMI,YAAYC,QAAQC,QAAQ,KAAK,WAAW,kBAAkBC,IAAI,CAACF,QAAQG,GAAG,CAACC,MAAM;AAC3F,IAAMC,OAAON,YAAY,aAAa;AAEtC,IAAMO,YAAYR,wBAAwB;AAC1C,IAAMS,aAAaT,wBAAwB;AAE3CU,OAAOC,OAAO,GAAG,SAASC,aAAaC,WAAW,EAAEC,OAAO;IACzD,IAAMC,WAAWhB;IACjB,IAAMiB,aAAad,QAAQG,GAAG;IAC9B,IAAMA,MAAM,CAAC;IACbA,IAAIY,kBAAkB,GAAGhB,YAAYY,cAAcjB,KAAKsB,IAAI,CAACL,aAAa;IAC1ER,IAAIc,eAAe,GAAGlB,YAAYY,cAAcjB,KAAKsB,IAAI,CAACL,aAAa;IACvER,IAAIe,cAAc,GAAGnB,YAAYY,cAAcjB,KAAKsB,IAAI,CAACL,aAAa;IACtER,IAAIgB,iBAAiB,GAAGR;IACxBR,IAAIiB,iBAAiB,GAAG1B,KAAKsB,IAAI,CAACb,IAAIY,kBAAkB,EAAEV;IAE1D,6EAA6E;IAC7E,IAAK,IAAMgB,OAAOP,WAAY;QAC5B,2CAA2C;QAC3C,IAAIO,IAAIC,MAAM,GAAG,KAAKhB,UAAUe,MAAM;QACtC,IAAIA,IAAIC,MAAM,KAAK,KAAKf,WAAWc,QAAQA,QAAQR,UAAU;QAC7DV,GAAG,CAACkB,IAAI,GAAGP,UAAU,CAACO,IAAI;IAC5B;IAEA,gBAAgB;IAChB,IAAIlB,IAAIE,IAAI,KAAKkB,WAAWpB,IAAIE,IAAI,GAAGF,IAAIiB,iBAAiB;IAC5D,IAAIjB,IAAIqB,QAAQ,KAAKD,WAAWpB,IAAIqB,QAAQ,GAAGrB,IAAIiB,iBAAiB;IAEpE,2DAA2D;IAC3DjB,GAAG,CAACU,SAAS,GAAGjB,QAAQO,GAAG,CAACU,SAAS,IAAI,IAAIV,IAAIY,kBAAkB;IACnE,OAAO,wCAAKH;QAASa,KAAKzB,QAAQyB,GAAG;QAAItB,KAAAA;;AAC3C"}
|
package/dist/cjs/spawnSync.js
CHANGED
|
@@ -4,4 +4,4 @@ var spawnOptions = require('./spawnOptions');
|
|
|
4
4
|
module.exports = function spawnSync(installPath, command, args, options) {
|
|
5
5
|
return crossSpawn.sync(command, args, spawnOptions(installPath, options));
|
|
6
6
|
};
|
|
7
|
-
/* CJS INTEROP */ if (exports.__esModule && exports.default) { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) exports.default[key] = exports[key]; module.exports = exports.default; }
|
|
7
|
+
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) { exports.default[key] = exports[key]; } } catch (_) {}; module.exports = exports.default; }
|
|
@@ -10,4 +10,4 @@ module.exports = function startsCaseInsensitiveFn(string) {
|
|
|
10
10
|
return true;
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
|
-
/* CJS INTEROP */ if (exports.__esModule && exports.default) { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) exports.default[key] = exports[key]; module.exports = exports.default; }
|
|
13
|
+
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) { exports.default[key] = exports[key]; } } catch (_) {}; module.exports = exports.default; }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-version-utils",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Utilities for running commands on a specific version of node by installed path",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"node",
|
|
@@ -34,19 +34,20 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"core-js": "^3.39.0",
|
|
37
|
-
"cross-spawn-cb": "^1.1.
|
|
37
|
+
"cross-spawn-cb": "^1.1.2",
|
|
38
38
|
"env-path-key": "^1.0.0",
|
|
39
|
-
"path-string-prepend": "^0.
|
|
39
|
+
"path-string-prepend": "^1.0.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
+
"@biomejs/biome": "^1.9.4",
|
|
42
43
|
"@types/mocha": "^10.0.10",
|
|
43
|
-
"@types/node": "^22.10.
|
|
44
|
+
"@types/node": "^22.10.2",
|
|
44
45
|
"cr": "^0.1.0",
|
|
45
46
|
"depcheck": "^1.4.7",
|
|
46
47
|
"is-version": "^0.2.1",
|
|
47
|
-
"node-install-release": "^1.4.
|
|
48
|
+
"node-install-release": "^1.4.3",
|
|
48
49
|
"node-resolve-versions": "^1.0.0",
|
|
49
|
-
"ts-dev-stack": "^
|
|
50
|
+
"ts-dev-stack": "^1.2.1"
|
|
50
51
|
},
|
|
51
52
|
"engines": {
|
|
52
53
|
"node": ">=0.8"
|