node-version-utils 0.5.5 → 0.5.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.
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ spawn: function() {
13
+ return _spawn.default;
14
+ },
15
+ spawnOptions: function() {
16
+ return _spawnOptions.default;
17
+ },
18
+ spawnSync: function() {
19
+ return _spawnSync.default;
20
+ }
21
+ });
22
+ require("./polyfills.js");
23
+ var _spawn = /*#__PURE__*/ _interop_require_default(require("./spawn"));
24
+ var _spawnSync = /*#__PURE__*/ _interop_require_default(require("./spawnSync"));
25
+ var _spawnOptions = /*#__PURE__*/ _interop_require_default(require("./spawnOptions"));
26
+ function _interop_require_default(obj) {
27
+ return obj && obj.__esModule ? obj : {
28
+ default: obj
29
+ };
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; }
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.mjs"],"sourcesContent":["import './polyfills.cjs';\n\nexport { default as spawn } from './spawn';\nexport { default as spawnSync } from './spawnSync';\nexport { default as spawnOptions } from './spawnOptions';\n"],"names":["spawn","spawnOptions","spawnSync"],"mappings":";;;;;;;;;;;IAEoBA,KAAK;eAALA,cAAK;;IAELC,YAAY;eAAZA,qBAAY;;IADZC,SAAS;eAATA,kBAAS;;;QAHtB;4DAE0B;gEACI;mEACG"}
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -0,0 +1,3 @@
1
+ "use strict";
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; }
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["polyfills.cjs"],"sourcesContent":["require('core-js/actual/promise');\n"],"names":["require"],"mappings":";AAAAA,QAAQ"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var crossSpawn = require('cross-spawn-cb');
3
+ var spawnOptions = require('./spawnOptions');
4
+ module.exports = function spawn(installPath, command, args, options, callback) {
5
+ if (typeof options === 'function') {
6
+ callback = options;
7
+ options = {};
8
+ }
9
+ if (typeof callback === 'function') {
10
+ return crossSpawn(command, args, spawnOptions(installPath, options || {}), callback);
11
+ }
12
+ return new Promise(function(resolve, reject) {
13
+ spawn(installPath, command, args, options, function spawnCallback(err, res) {
14
+ err ? reject(err) : resolve(res);
15
+ });
16
+ });
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; }
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["spawn.js"],"sourcesContent":["const crossSpawn = require('cross-spawn-cb');\nconst spawnOptions = require('./spawnOptions');\n\nmodule.exports = function spawn(installPath, command, args, options, callback) {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n\n if (typeof callback === 'function') {\n return crossSpawn(command, args, spawnOptions(installPath, options || {}), callback);\n }\n return new Promise((resolve, reject) => {\n spawn(installPath, command, args, options, function spawnCallback(err, res) {\n err ? reject(err) : resolve(res);\n });\n });\n};\n"],"names":["crossSpawn","require","spawnOptions","module","exports","spawn","installPath","command","args","options","callback","Promise","resolve","reject","spawnCallback","err","res"],"mappings":";AAAA,IAAMA,aAAaC,QAAQ;AAC3B,IAAMC,eAAeD,QAAQ;AAE7BE,OAAOC,OAAO,GAAG,SAASC,MAAMC,WAAW,EAAEC,OAAO,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAQ;IAC3E,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU,CAAC;IACb;IAEA,IAAI,OAAOC,aAAa,YAAY;QAClC,OAAOV,WAAWO,SAASC,MAAMN,aAAaI,aAAaG,WAAW,CAAC,IAAIC;IAC7E;IACA,OAAO,IAAIC,QAAQ,SAACC,SAASC;QAC3BR,MAAMC,aAAaC,SAASC,MAAMC,SAAS,SAASK,cAAcC,GAAG,EAAEC,GAAG;YACxED,MAAMF,OAAOE,OAAOH,QAAQI;QAC9B;IACF;AACF"}
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ function _define_property(obj, key, value) {
3
+ if (key in obj) {
4
+ Object.defineProperty(obj, key, {
5
+ value: value,
6
+ enumerable: true,
7
+ configurable: true,
8
+ writable: true
9
+ });
10
+ } else {
11
+ obj[key] = value;
12
+ }
13
+ return obj;
14
+ }
15
+ function _object_spread(target) {
16
+ for(var i = 1; i < arguments.length; i++){
17
+ var source = arguments[i] != null ? arguments[i] : {};
18
+ var ownKeys = Object.keys(source);
19
+ if (typeof Object.getOwnPropertySymbols === "function") {
20
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
21
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
22
+ }));
23
+ }
24
+ ownKeys.forEach(function(key) {
25
+ _define_property(target, key, source[key]);
26
+ });
27
+ }
28
+ return target;
29
+ }
30
+ function ownKeys(object, enumerableOnly) {
31
+ var keys = Object.keys(object);
32
+ if (Object.getOwnPropertySymbols) {
33
+ var symbols = Object.getOwnPropertySymbols(object);
34
+ if (enumerableOnly) {
35
+ symbols = symbols.filter(function(sym) {
36
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
37
+ });
38
+ }
39
+ keys.push.apply(keys, symbols);
40
+ }
41
+ return keys;
42
+ }
43
+ function _object_spread_props(target, source) {
44
+ source = source != null ? source : {};
45
+ if (Object.getOwnPropertyDescriptors) {
46
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
47
+ } else {
48
+ ownKeys(Object(source)).forEach(function(key) {
49
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
50
+ });
51
+ }
52
+ return target;
53
+ }
54
+ var path = require('path');
55
+ var prepend = require('path-string-prepend');
56
+ var NODE = process.platform === 'win32' ? 'node.exe' : 'node';
57
+ var pathKey = require('env-path-key');
58
+ var startsCaseInsensitiveFn = require('./startsCaseInsensitiveFn');
59
+ var isWindows = process.platform === 'win32';
60
+ var startsNPM = startsCaseInsensitiveFn('npm_');
61
+ var startsPath = startsCaseInsensitiveFn('path');
62
+ module.exports = function spawnOptions(installPath, options) {
63
+ var PATH_KEY = pathKey();
64
+ var processEnv = process.env;
65
+ var env = {};
66
+ env.npm_config_binroot = isWindows ? installPath : path.join(installPath, 'bin');
67
+ env.npm_config_root = isWindows ? installPath : path.join(installPath, 'lib');
68
+ env.npm_config_man = isWindows ? installPath : path.join(installPath, 'man');
69
+ env.npm_config_prefix = installPath;
70
+ env.npm_node_execpath = path.join(env.npm_config_binroot, NODE);
71
+ // copy the environment not for npm and skip case-insesitive additional paths
72
+ for(var key in processEnv){
73
+ // skip npm_ variants and non-matching path
74
+ if (key.length > 4 && startsNPM(key)) continue;
75
+ if (key.length === 4 && startsPath(key) && key !== PATH_KEY) continue;
76
+ env[key] = processEnv[key];
77
+ }
78
+ // override node
79
+ if (env.NODE !== undefined) env.NODE = env.npm_node_execpath;
80
+ if (env.NODE_EXE !== undefined) env.NODE_EXE = env.npm_node_execpath;
81
+ // put the path to node and npm at the front and remove nvs
82
+ env[PATH_KEY] = prepend(env[PATH_KEY] || '', env.npm_config_binroot);
83
+ return _object_spread_props(_object_spread({}, options), {
84
+ cwd: process.cwd(),
85
+ env: env
86
+ });
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; }
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["spawnOptions.js"],"sourcesContent":["const path = require('path');\nconst prepend = require('path-string-prepend');\nconst NODE = process.platform === 'win32' ? 'node.exe' : 'node';\nconst pathKey = require('env-path-key');\nconst startsCaseInsensitiveFn = require('./startsCaseInsensitiveFn');\n\nconst isWindows = process.platform === 'win32';\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","NODE","process","platform","pathKey","startsCaseInsensitiveFn","isWindows","startsNPM","startsPath","module","exports","spawnOptions","installPath","options","PATH_KEY","processEnv","env","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,OAAOC,QAAQC,QAAQ,KAAK,UAAU,aAAa;AACzD,IAAMC,UAAUL,QAAQ;AACxB,IAAMM,0BAA0BN,QAAQ;AAExC,IAAMO,YAAYJ,QAAQC,QAAQ,KAAK;AAEvC,IAAMI,YAAYF,wBAAwB;AAC1C,IAAMG,aAAaH,wBAAwB;AAE3CI,OAAOC,OAAO,GAAG,SAASC,aAAaC,WAAW,EAAEC,OAAO;IACzD,IAAMC,WAAWV;IACjB,IAAMW,aAAab,QAAQc,GAAG;IAC9B,IAAMA,MAAM,CAAC;IACbA,IAAIC,kBAAkB,GAAGX,YAAYM,cAAcd,KAAKoB,IAAI,CAACN,aAAa;IAC1EI,IAAIG,eAAe,GAAGb,YAAYM,cAAcd,KAAKoB,IAAI,CAACN,aAAa;IACvEI,IAAII,cAAc,GAAGd,YAAYM,cAAcd,KAAKoB,IAAI,CAACN,aAAa;IACtEI,IAAIK,iBAAiB,GAAGT;IACxBI,IAAIM,iBAAiB,GAAGxB,KAAKoB,IAAI,CAACF,IAAIC,kBAAkB,EAAEhB;IAE1D,6EAA6E;IAC7E,IAAK,IAAMsB,OAAOR,WAAY;QAC5B,2CAA2C;QAC3C,IAAIQ,IAAIC,MAAM,GAAG,KAAKjB,UAAUgB,MAAM;QACtC,IAAIA,IAAIC,MAAM,KAAK,KAAKhB,WAAWe,QAAQA,QAAQT,UAAU;QAC7DE,GAAG,CAACO,IAAI,GAAGR,UAAU,CAACQ,IAAI;IAC5B;IAEA,gBAAgB;IAChB,IAAIP,IAAIf,IAAI,KAAKwB,WAAWT,IAAIf,IAAI,GAAGe,IAAIM,iBAAiB;IAC5D,IAAIN,IAAIU,QAAQ,KAAKD,WAAWT,IAAIU,QAAQ,GAAGV,IAAIM,iBAAiB;IAEpE,2DAA2D;IAC3DN,GAAG,CAACF,SAAS,GAAGd,QAAQgB,GAAG,CAACF,SAAS,IAAI,IAAIE,IAAIC,kBAAkB;IACnE,OAAO,wCAAKJ;QAASc,KAAKzB,QAAQyB,GAAG;QAAIX,KAAAA;;AAC3C"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ var crossSpawn = require('cross-spawn-cb');
3
+ var spawnOptions = require('./spawnOptions');
4
+ module.exports = function spawnSync(installPath, command, args, options) {
5
+ return crossSpawn.sync(command, args, spawnOptions(installPath, options));
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; }
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["spawnSync.js"],"sourcesContent":["const crossSpawn = require('cross-spawn-cb');\nconst spawnOptions = require('./spawnOptions');\n\nmodule.exports = function spawnSync(installPath, command, args, options) {\n return crossSpawn.sync(command, args, spawnOptions(installPath, options));\n};\n"],"names":["crossSpawn","require","spawnOptions","module","exports","spawnSync","installPath","command","args","options","sync"],"mappings":";AAAA,IAAMA,aAAaC,QAAQ;AAC3B,IAAMC,eAAeD,QAAQ;AAE7BE,OAAOC,OAAO,GAAG,SAASC,UAAUC,WAAW,EAAEC,OAAO,EAAEC,IAAI,EAAEC,OAAO;IACrE,OAAOT,WAAWU,IAAI,CAACH,SAASC,MAAMN,aAAaI,aAAaG;AAClE"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ module.exports = function startsCaseInsensitiveFn(string) {
3
+ var lower = string.toLowerCase();
4
+ var upper = string.toUpperCase();
5
+ return function startsCaseInsensitive(key) {
6
+ if (key.length < string.length) return false;
7
+ for(var i = 0; i < string.length; i++){
8
+ if (key[i] !== lower[i] && key[i] !== upper[i]) return false;
9
+ }
10
+ return true;
11
+ };
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; }
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["startsCaseInsensitiveFn.js"],"sourcesContent":["module.exports = function startsCaseInsensitiveFn(string) {\n const lower = string.toLowerCase();\n const upper = string.toUpperCase();\n return function startsCaseInsensitive(key) {\n if (key.length < string.length) return false;\n for (let i = 0; i < string.length; i++) {\n if (key[i] !== lower[i] && key[i] !== upper[i]) return false;\n }\n return true;\n };\n};\n"],"names":["module","exports","startsCaseInsensitiveFn","string","lower","toLowerCase","upper","toUpperCase","startsCaseInsensitive","key","length","i"],"mappings":";AAAAA,OAAOC,OAAO,GAAG,SAASC,wBAAwBC,MAAM;IACtD,IAAMC,QAAQD,OAAOE,WAAW;IAChC,IAAMC,QAAQH,OAAOI,WAAW;IAChC,OAAO,SAASC,sBAAsBC,GAAG;QACvC,IAAIA,IAAIC,MAAM,GAAGP,OAAOO,MAAM,EAAE,OAAO;QACvC,IAAK,IAAIC,IAAI,GAAGA,IAAIR,OAAOO,MAAM,EAAEC,IAAK;YACtC,IAAIF,GAAG,CAACE,EAAE,KAAKP,KAAK,CAACO,EAAE,IAAIF,GAAG,CAACE,EAAE,KAAKL,KAAK,CAACK,EAAE,EAAE,OAAO;QACzD;QACA,OAAO;IACT;AACF"}
@@ -0,0 +1,3 @@
1
+ export { default as spawn } from "./spawn";
2
+ export { default as spawnSync } from "./spawnSync";
3
+ export { default as spawnOptions } from "./spawnOptions";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ declare function _exports(installPath: any, command: any, args: any, options: any, callback: any): any;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare function _exports(installPath: any, options: any): any;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare function _exports(installPath: any, command: any, args: any, options: any): any;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare function _exports(string: any): (key: any) => boolean;
2
+ export = _exports;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-version-utils",
3
- "version": "0.5.5",
3
+ "version": "0.5.7",
4
4
  "description": "Utilities for running commands on a specific version of node by installed path",
5
5
  "keywords": [
6
6
  "node",
@@ -19,44 +19,42 @@
19
19
  "url": "git@github.com:kmalakoff/node-version-utils.git"
20
20
  },
21
21
  "license": "MIT",
22
- "main": "lib/index.js",
22
+ "main": "dist/cjs/index.js",
23
+ "types": "dist/types/index.d.ts",
23
24
  "files": [
24
- "lib"
25
+ "dist"
25
26
  ],
26
27
  "scripts": {
27
- "build": "",
28
- "format": "prettier --write .",
29
- "lint": "eslint .",
30
- "prepublishOnly": "npm run lint && depcheck",
31
- "test": "mocha-compat test/spec/**/*.test.js --no-timeouts",
32
- "test:engines": "nvu engines npm test"
28
+ "build": "tsds build",
29
+ "deploy": "tsds deploy",
30
+ "format": "biome check --write --unsafe src/ test/",
31
+ "test": "tsds test:node --timeout=20000",
32
+ "test:engines": "nvu engines npm test",
33
+ "version": "tsds version"
33
34
  },
34
35
  "dependencies": {
35
- "cross-spawn-cb": "^0.6.10",
36
- "env-path-key": "^0.3.0",
37
- "es6-promise": "^4.2.8",
38
- "just-extend": "^6.0.1",
39
- "path-string-prepend": "^0.2.1",
40
- "rimraf": "^2.7.1"
36
+ "core-js": "^3.39.0",
37
+ "cross-spawn-cb": "^1.1.0",
38
+ "env-path-key": "^1.0.0",
39
+ "path-string-prepend": "^0.2.2"
41
40
  },
42
41
  "devDependencies": {
43
- "@typescript-eslint/parser": "^5.32.0",
42
+ "@types/mocha": "^10.0.10",
43
+ "@types/node": "^22.10.1",
44
44
  "cr": "^0.1.0",
45
- "depcheck": "^1.4.3",
46
- "eslint": "^8.21.0",
47
- "eslint-config-prettier": "^8.5.0",
48
- "eslint-config-standard": "^17.0.0",
49
- "eslint-plugin-import": "^2.26.0",
50
- "eslint-plugin-promise": "^6.0.0",
45
+ "depcheck": "^1.4.7",
51
46
  "is-version": "^0.2.1",
52
- "lodash.find": "^4.6.0",
53
- "match-semver": "^0.1.1",
54
- "mocha-compat": "^3.5.5",
55
- "node-install-release": "^0.3.12",
56
- "prettier": "^2.7.1",
57
- "semver": "^5.7.1"
47
+ "node-install-release": "^1.4.0",
48
+ "node-resolve-versions": "^1.0.0",
49
+ "ts-dev-stack": "^0.16.3"
58
50
  },
59
51
  "engines": {
60
52
  "node": ">=0.8"
53
+ },
54
+ "tsds": {
55
+ "source": "src/index.mjs",
56
+ "targets": [
57
+ "cjs"
58
+ ]
61
59
  }
62
60
  }
package/lib/index.js DELETED
@@ -1,7 +0,0 @@
1
- require('./polyfills');
2
-
3
- module.exports = {
4
- spawn: require('./spawn'),
5
- spawnSync: require('./spawnSync'),
6
- spawnOptions: require('./spawnOptions'),
7
- };
package/lib/polyfills.js DELETED
@@ -1 +0,0 @@
1
- require('es6-promise/auto');
package/lib/spawn.js DELETED
@@ -1,18 +0,0 @@
1
- var crossSpawn = require('cross-spawn-cb');
2
- var spawnOptions = require('./spawnOptions');
3
-
4
- module.exports = function spawn(installPath, command, args, options, callback) {
5
- if (typeof options === 'function') {
6
- callback = options;
7
- options = {};
8
- }
9
-
10
- if (typeof callback === 'function') {
11
- return crossSpawn(command, args, spawnOptions(installPath, options || {}), callback);
12
- }
13
- return new Promise(function (resolve, reject) {
14
- spawn(installPath, command, args, options, function spawnCallback(err, res) {
15
- err ? reject(err) : resolve(res);
16
- });
17
- });
18
- };
@@ -1,38 +0,0 @@
1
- var path = require('path');
2
- var assign = require('just-extend');
3
- var prepend = require('path-string-prepend');
4
- var NODE = process.platform === 'win32' ? 'node.exe' : 'node';
5
- var pathKey = require('env-path-key');
6
- var startsCaseInsensitiveFn = require('./startsCaseInsensitiveFn');
7
-
8
- var isWindows = process.platform === 'win32';
9
-
10
- var startsNPM = startsCaseInsensitiveFn('npm_');
11
- var startsPath = startsCaseInsensitiveFn('path');
12
-
13
- module.exports = function spawnOptions(installPath, options) {
14
- var PATH_KEY = pathKey();
15
- var processEnv = process.env;
16
- var env = {};
17
- env.npm_config_binroot = isWindows ? installPath : path.join(installPath, 'bin');
18
- env.npm_config_root = isWindows ? installPath : path.join(installPath, 'lib');
19
- env.npm_config_man = isWindows ? installPath : path.join(installPath, 'man');
20
- env.npm_config_prefix = installPath;
21
- env.npm_node_execpath = path.join(env.npm_config_binroot, NODE);
22
-
23
- // copy the environment not for npm and skip case-insesitive additional paths
24
- for (var key in processEnv) {
25
- // skip npm_ variants and non-matching path
26
- if (key.length > 4 && startsNPM(key)) continue;
27
- if (key.length === 4 && startsPath(key) && key !== PATH_KEY) continue;
28
- env[key] = processEnv[key];
29
- }
30
-
31
- // override node
32
- if (env.NODE !== undefined) env.NODE = env.npm_node_execpath;
33
- if (env.NODE_EXE !== undefined) env.NODE_EXE = env.npm_node_execpath;
34
-
35
- // put the path to node and npm at the front and remove nvs
36
- env[PATH_KEY] = prepend(env[PATH_KEY] || '', env.npm_config_binroot);
37
- return assign({}, options, { cwd: process.cwd(), env: env });
38
- };
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
- };
@@ -1,11 +0,0 @@
1
- module.exports = function startsCaseInsensitiveFn(string) {
2
- var lower = string.toLowerCase();
3
- var upper = string.toUpperCase();
4
- return function startsCaseInsensitive(key) {
5
- if (key.length < string.length) return false;
6
- for (var i = 0; i < string.length; i++) {
7
- if (key[i] !== lower[i] && key[i] !== upper[i]) return false;
8
- }
9
- return true;
10
- };
11
- };