Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

node-version-utils

Package Overview
Dependencies
Maintainers
1
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-version-utils - npm Package Compare versions

Comparing version
1.3.14
to
1.3.15
+1
-1
dist/cjs/spawnOptions.js

@@ -106,3 +106,3 @@ "use strict";

}
var basePath = env[PATH_KEY] || '';
var basePath = env[PATH_KEY] || process.env[PATH_KEY] || '';
env[PATH_KEY] = (0, _pathstringprepend.default)(basePath, bin);

@@ -109,0 +109,0 @@ return _object_spread_props(_object_spread({}, options), {

@@ -1,1 +0,1 @@

{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-version-utils/src/spawnOptions.ts"],"sourcesContent":["import pathKey from 'env-path-key';\nimport fs from 'fs';\nimport path from 'path';\nimport prepend from 'path-string-prepend';\nimport startsWithFn from './lib/startsWithFn.ts';\n\nconst isWindows = process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE);\nconst NODE = isWindows ? 'node.exe' : 'node';\n\nconst startsNPM = startsWithFn('npm_');\nconst startsPath = startsWithFn('path');\n\nimport type { ProcessEnv, SpawnOptions } from './types.ts';\n\nexport default function spawnOptions(installPath: string, options: SpawnOptions = {}): SpawnOptions {\n // Resolve symlinks to get real path (fixes nvm-windows symlink issues where\n // C:\\nvm4w\\nodejs points to the active Node version via symlink)\n try {\n installPath = fs.realpathSync(installPath);\n } catch (_e) {\n // Keep original path if resolution fails\n }\n\n const PATH_KEY = pathKey();\n const processEnv = options.env || process.env;\n const bin = isWindows ? installPath : path.join(installPath, 'bin');\n const env = {} as ProcessEnv;\n env.npm_node_execpath = path.join(bin, NODE);\n env.npm_config_prefix = installPath;\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\n if (options.env && !options.env[PATH_KEY]) {\n throw new Error(`node-version-utils: options.env missing required ${PATH_KEY}`);\n }\n const basePath = env[PATH_KEY] || '';\n env[PATH_KEY] = prepend(basePath, bin) as string;\n return { ...options, cwd: process.cwd(), env } as SpawnOptions;\n}\n"],"names":["spawnOptions","isWindows","process","platform","test","env","OSTYPE","NODE","startsNPM","startsWithFn","startsPath","installPath","options","fs","realpathSync","_e","PATH_KEY","pathKey","processEnv","bin","path","join","npm_node_execpath","npm_config_prefix","key","length","undefined","NODE_EXE","Error","basePath","prepend","cwd"],"mappings":";;;;+BAcA;;;eAAwBA;;;iEAdJ;yDACL;2DACE;wEACG;qEACK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEzB,IAAMC,YAAYC,QAAQC,QAAQ,KAAK,WAAW,kBAAkBC,IAAI,CAACF,QAAQG,GAAG,CAACC,MAAM;AAC3F,IAAMC,OAAON,YAAY,aAAa;AAEtC,IAAMO,YAAYC,IAAAA,uBAAY,EAAC;AAC/B,IAAMC,aAAaD,IAAAA,uBAAY,EAAC;AAIjB,SAAST,aAAaW,WAAmB;QAAEC,UAAAA,iEAAwB,CAAC;IACjF,4EAA4E;IAC5E,iEAAiE;IACjE,IAAI;QACFD,cAAcE,WAAE,CAACC,YAAY,CAACH;IAChC,EAAE,OAAOI,IAAI;IACX,yCAAyC;IAC3C;IAEA,IAAMC,WAAWC,IAAAA,mBAAO;IACxB,IAAMC,aAAaN,QAAQP,GAAG,IAAIH,QAAQG,GAAG;IAC7C,IAAMc,MAAMlB,YAAYU,cAAcS,aAAI,CAACC,IAAI,CAACV,aAAa;IAC7D,IAAMN,MAAM,CAAC;IACbA,IAAIiB,iBAAiB,GAAGF,aAAI,CAACC,IAAI,CAACF,KAAKZ;IACvCF,IAAIkB,iBAAiB,GAAGZ;IAExB,6EAA6E;IAC7E,IAAK,IAAMa,OAAON,WAAY;QAC5B,2CAA2C;QAC3C,IAAIM,IAAIC,MAAM,GAAG,KAAKjB,UAAUgB,MAAM;QACtC,IAAIA,IAAIC,MAAM,KAAK,KAAKf,WAAWc,QAAQA,QAAQR,UAAU;QAC7DX,GAAG,CAACmB,IAAI,GAAGN,UAAU,CAACM,IAAI;IAC5B;IAEA,gBAAgB;IAChB,IAAInB,IAAIE,IAAI,KAAKmB,WAAWrB,IAAIE,IAAI,GAAGF,IAAIiB,iBAAiB;IAC5D,IAAIjB,IAAIsB,QAAQ,KAAKD,WAAWrB,IAAIsB,QAAQ,GAAGtB,IAAIiB,iBAAiB;IAEpE,4CAA4C;IAC5C,IAAIV,QAAQP,GAAG,IAAI,CAACO,QAAQP,GAAG,CAACW,SAAS,EAAE;QACzC,MAAM,IAAIY,MAAM,AAAC,oDAA4D,OAATZ;IACtE;IACA,IAAMa,WAAWxB,GAAG,CAACW,SAAS,IAAI;IAClCX,GAAG,CAACW,SAAS,GAAGc,IAAAA,0BAAO,EAACD,UAAUV;IAClC,OAAO,wCAAKP;QAASmB,KAAK7B,QAAQ6B,GAAG;QAAI1B,KAAAA;;AAC3C"}
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-version-utils/src/spawnOptions.ts"],"sourcesContent":["import pathKey from 'env-path-key';\nimport fs from 'fs';\nimport path from 'path';\nimport prepend from 'path-string-prepend';\nimport startsWithFn from './lib/startsWithFn.ts';\n\nconst isWindows = process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE);\nconst NODE = isWindows ? 'node.exe' : 'node';\n\nconst startsNPM = startsWithFn('npm_');\nconst startsPath = startsWithFn('path');\n\nimport type { ProcessEnv, SpawnOptions } from './types.ts';\n\nexport default function spawnOptions(installPath: string, options: SpawnOptions = {}): SpawnOptions {\n // Resolve symlinks to get real path (fixes nvm-windows symlink issues where\n // C:\\nvm4w\\nodejs points to the active Node version via symlink)\n try {\n installPath = fs.realpathSync(installPath);\n } catch (_e) {\n // Keep original path if resolution fails\n }\n\n const PATH_KEY = pathKey();\n const processEnv = options.env || process.env;\n const bin = isWindows ? installPath : path.join(installPath, 'bin');\n const env = {} as ProcessEnv;\n env.npm_node_execpath = path.join(bin, NODE);\n env.npm_config_prefix = installPath;\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\n if (options.env && !options.env[PATH_KEY]) {\n throw new Error(`node-version-utils: options.env missing required ${PATH_KEY}`);\n }\n const basePath = env[PATH_KEY] || process.env[PATH_KEY] || '';\n env[PATH_KEY] = prepend(basePath, bin) as string;\n return { ...options, cwd: process.cwd(), env } as SpawnOptions;\n}\n"],"names":["spawnOptions","isWindows","process","platform","test","env","OSTYPE","NODE","startsNPM","startsWithFn","startsPath","installPath","options","fs","realpathSync","_e","PATH_KEY","pathKey","processEnv","bin","path","join","npm_node_execpath","npm_config_prefix","key","length","undefined","NODE_EXE","Error","basePath","prepend","cwd"],"mappings":";;;;+BAcA;;;eAAwBA;;;iEAdJ;yDACL;2DACE;wEACG;qEACK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEzB,IAAMC,YAAYC,QAAQC,QAAQ,KAAK,WAAW,kBAAkBC,IAAI,CAACF,QAAQG,GAAG,CAACC,MAAM;AAC3F,IAAMC,OAAON,YAAY,aAAa;AAEtC,IAAMO,YAAYC,IAAAA,uBA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AAKP;QAASmB,KAAK7B,QAAQ6B,GAAG;QAAI1B,KAAAA;;AAC3C"}

@@ -38,3 +38,3 @@ import pathKey from 'env-path-key';

}
const basePath = env[PATH_KEY] || '';
const basePath = env[PATH_KEY] || process.env[PATH_KEY] || '';
env[PATH_KEY] = prepend(basePath, bin);

@@ -41,0 +41,0 @@ return {

@@ -1,1 +0,1 @@

{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-version-utils/src/spawnOptions.ts"],"sourcesContent":["import pathKey from 'env-path-key';\nimport fs from 'fs';\nimport path from 'path';\nimport prepend from 'path-string-prepend';\nimport startsWithFn from './lib/startsWithFn.ts';\n\nconst isWindows = process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE);\nconst NODE = isWindows ? 'node.exe' : 'node';\n\nconst startsNPM = startsWithFn('npm_');\nconst startsPath = startsWithFn('path');\n\nimport type { ProcessEnv, SpawnOptions } from './types.ts';\n\nexport default function spawnOptions(installPath: string, options: SpawnOptions = {}): SpawnOptions {\n // Resolve symlinks to get real path (fixes nvm-windows symlink issues where\n // C:\\nvm4w\\nodejs points to the active Node version via symlink)\n try {\n installPath = fs.realpathSync(installPath);\n } catch (_e) {\n // Keep original path if resolution fails\n }\n\n const PATH_KEY = pathKey();\n const processEnv = options.env || process.env;\n const bin = isWindows ? installPath : path.join(installPath, 'bin');\n const env = {} as ProcessEnv;\n env.npm_node_execpath = path.join(bin, NODE);\n env.npm_config_prefix = installPath;\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\n if (options.env && !options.env[PATH_KEY]) {\n throw new Error(`node-version-utils: options.env missing required ${PATH_KEY}`);\n }\n const basePath = env[PATH_KEY] || '';\n env[PATH_KEY] = prepend(basePath, bin) as string;\n return { ...options, cwd: process.cwd(), env } as SpawnOptions;\n}\n"],"names":["pathKey","fs","path","prepend","startsWithFn","isWindows","process","platform","test","env","OSTYPE","NODE","startsNPM","startsPath","spawnOptions","installPath","options","realpathSync","_e","PATH_KEY","processEnv","bin","join","npm_node_execpath","npm_config_prefix","key","length","undefined","NODE_EXE","Error","basePath","cwd"],"mappings":"AAAA,OAAOA,aAAa,eAAe;AACnC,OAAOC,QAAQ,KAAK;AACpB,OAAOC,UAAU,OAAO;AACxB,OAAOC,aAAa,sBAAsB;AAC1C,OAAOC,kBAAkB,wBAAwB;AAEjD,MAAMC,YAAYC,QAAQC,QAAQ,KAAK,WAAW,kBAAkBC,IAAI,CAACF,QAAQG,GAAG,CAACC,MAAM;AAC3F,MAAMC,OAAON,YAAY,aAAa;AAEtC,MAAMO,YAAYR,aAAa;AAC/B,MAAMS,aAAaT,aAAa;AAIhC,eAAe,SAASU,aAAaC,WAAmB,EAAEC,UAAwB,CAAC,CAAC;IAClF,4EAA4E;IAC5E,iEAAiE;IACjE,IAAI;QACFD,cAAcd,GAAGgB,YAAY,CAACF;IAChC,EAAE,OAAOG,IAAI;IACX,yCAAyC;IAC3C;IAEA,MAAMC,WAAWnB;IACjB,MAAMoB,aAAaJ,QAAQP,GAAG,IAAIH,QAAQG,GAAG;IAC7C,MAAMY,MAAMhB,YAAYU,cAAcb,KAAKoB,IAAI,CAACP,aAAa;IAC7D,MAAMN,MAAM,CAAC;IACbA,IAAIc,iBAAiB,GAAGrB,KAAKoB,IAAI,CAACD,KAAKV;IACvCF,IAAIe,iBAAiB,GAAGT;IAExB,6EAA6E;IAC7E,IAAK,MAAMU,OAAOL,WAAY;QAC5B,2CAA2C;QAC3C,IAAIK,IAAIC,MAAM,GAAG,KAAKd,UAAUa,MAAM;QACtC,IAAIA,IAAIC,MAAM,KAAK,KAAKb,WAAWY,QAAQA,QAAQN,UAAU;QAC7DV,GAAG,CAACgB,IAAI,GAAGL,UAAU,CAACK,IAAI;IAC5B;IAEA,gBAAgB;IAChB,IAAIhB,IAAIE,IAAI,KAAKgB,WAAWlB,IAAIE,IAAI,GAAGF,IAAIc,iBAAiB;IAC5D,IAAId,IAAImB,QAAQ,KAAKD,WAAWlB,IAAImB,QAAQ,GAAGnB,IAAIc,iBAAiB;IAEpE,4CAA4C;IAC5C,IAAIP,QAAQP,GAAG,IAAI,CAACO,QAAQP,GAAG,CAACU,SAAS,EAAE;QACzC,MAAM,IAAIU,MAAM,CAAC,iDAAiD,EAAEV,UAAU;IAChF;IACA,MAAMW,WAAWrB,GAAG,CAACU,SAAS,IAAI;IAClCV,GAAG,CAACU,SAAS,GAAGhB,QAAQ2B,UAAUT;IAClC,OAAO;QAAE,GAAGL,OAAO;QAAEe,KAAKzB,QAAQyB,GAAG;QAAItB;IAAI;AAC/C"}
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-version-utils/src/spawnOptions.ts"],"sourcesContent":["import pathKey from 'env-path-key';\nimport fs from 'fs';\nimport path from 'path';\nimport prepend from 'path-string-prepend';\nimport startsWithFn from './lib/startsWithFn.ts';\n\nconst isWindows = process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE);\nconst NODE = isWindows ? 'node.exe' : 'node';\n\nconst startsNPM = startsWithFn('npm_');\nconst startsPath = startsWithFn('path');\n\nimport type { ProcessEnv, SpawnOptions } from './types.ts';\n\nexport default function spawnOptions(installPath: string, options: SpawnOptions = {}): SpawnOptions {\n // Resolve symlinks to get real path (fixes nvm-windows symlink issues where\n // C:\\nvm4w\\nodejs points to the active Node version via symlink)\n try {\n installPath = fs.realpathSync(installPath);\n } catch (_e) {\n // Keep original path if resolution fails\n }\n\n const PATH_KEY = pathKey();\n const processEnv = options.env || process.env;\n const bin = isWindows ? installPath : path.join(installPath, 'bin');\n const env = {} as ProcessEnv;\n env.npm_node_execpath = path.join(bin, NODE);\n env.npm_config_prefix = installPath;\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\n if (options.env && !options.env[PATH_KEY]) {\n throw new Error(`node-version-utils: options.env missing required ${PATH_KEY}`);\n }\n const basePath = env[PATH_KEY] || process.env[PATH_KEY] || '';\n env[PATH_KEY] = prepend(basePath, bin) as string;\n return { ...options, cwd: process.cwd(), env } as SpawnOptions;\n}\n"],"names":["pathKey","fs","path","prepend","startsWithFn","isWindows","process","platform","test","env","OSTYPE","NODE","startsNPM","startsPath","spawnOptions","installPath","options","realpathSync","_e","PATH_KEY","processEnv","bin","join","npm_node_execpath","npm_config_prefix","key","length","undefined","NODE_EXE","Error","basePath","cwd"],"mappings":"AAAA,OAAOA,aAAa,eAAe;AACnC,OAAOC,QAAQ,KAAK;AACpB,OAAOC,UAAU,OAAO;AACxB,OAAOC,aAAa,sBAAsB;AAC1C,OAAOC,kBAAkB,wBAAwB;AAEjD,MAAMC,YAAYC,QAAQC,QAAQ,KAAK,WAAW,kBAAkBC,IAAI,CAACF,QAAQG,GAAG,CAACC,MAAM;AAC3F,MAAMC,OAAON,YAAY,aAAa;AAEtC,MAAMO,YAAYR,aAAa;AAC/B,MAAMS,aAAaT,aAAa;AAIhC,eAAe,SAASU,aAAaC,WAAmB,EAAEC,UAAwB,CAAC,CAAC;IAClF,4EAA4E;IAC5E,iEAAiE;IACjE,IAAI;QACFD,cAAcd,GAAGgB,YAAY,CAACF;IAChC,EAAE,OAAOG,IAAI;IACX,yCAAyC;IAC3C;IAEA,MAAMC,WAAWnB;IACjB,MAAMoB,aAAaJ,QAAQP,GAAG,IAAIH,QAAQG,GAAG;IAC7C,MAAMY,MAAMhB,YAAYU,cAAcb,KAAKoB,IAAI,CAACP,aAAa;IAC7D,MAAMN,MAAM,CAAC;IACbA,IAAIc,iBAAiB,GAAGrB,KAAKoB,IAAI,CAACD,KAAKV;IACvCF,IAAIe,iBAAiB,GAAGT;IAExB,6EAA6E;IAC7E,IAAK,MAAMU,OAAOL,WAAY;QAC5B,2CAA2C;QAC3C,IAAIK,IAAIC,MAAM,GAAG,KAAKd,UAAUa,MAAM;QACtC,IAAIA,IAAIC,MAAM,KAAK,KAAKb,WAAWY,QAAQA,QAAQN,UAAU;QAC7DV,GAAG,CAACgB,IAAI,GAAGL,UAAU,CAACK,IAAI;IAC5B;IAEA,gBAAgB;IAChB,IAAIhB,IAAIE,IAAI,KAAKgB,WAAWlB,IAAIE,IAAI,GAAGF,IAAIc,iBAAiB;IAC5D,IAAId,IAAImB,QAAQ,KAAKD,WAAWlB,IAAImB,QAAQ,GAAGnB,IAAIc,iBAAiB;IAEpE,4CAA4C;IAC5C,IAAIP,QAAQP,GAAG,IAAI,CAACO,QAAQP,GAAG,CAACU,SAAS,EAAE;QACzC,MAAM,IAAIU,MAAM,CAAC,iDAAiD,EAAEV,UAAU;IAChF;IACA,MAAMW,WAAWrB,GAAG,CAACU,SAAS,IAAIb,QAAQG,GAAG,CAACU,SAAS,IAAI;IAC3DV,GAAG,CAACU,SAAS,GAAGhB,QAAQ2B,UAAUT;IAClC,OAAO;QAAE,GAAGL,OAAO;QAAEe,KAAKzB,QAAQyB,GAAG;QAAItB;IAAI;AAC/C"}
{
"name": "node-version-utils",
"version": "1.3.14",
"version": "1.3.15",
"description": "Utilities for running commands on a specific version of node by installed path",

@@ -5,0 +5,0 @@ "keywords": [