node-version-install 0.1.0 → 0.1.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/dist/cjs/worker.js +1 -3
- package/dist/cjs/worker.js.map +1 -1
- package/dist/esm/worker.mjs +1 -3
- package/dist/esm/worker.mjs.map +1 -1
- package/package.json +2 -2
package/dist/cjs/worker.js
CHANGED
|
@@ -79,9 +79,7 @@ function worker(versionExpression, options, callback) {
|
|
|
79
79
|
// TODO remove redundant options
|
|
80
80
|
err ? installRelease()(version, installPath, {
|
|
81
81
|
cachePath: cachePath,
|
|
82
|
-
buildPath: buildPath
|
|
83
|
-
cacheDirectory: cachePath,
|
|
84
|
-
buildDirectory: buildPath
|
|
82
|
+
buildPath: buildPath
|
|
85
83
|
}, done) : done();
|
|
86
84
|
});
|
|
87
85
|
});
|
package/dist/cjs/worker.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-version-install/src/worker.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport { NODE, isWindows } from './constants.js';\n\nimport home from 'homedir-polyfill';\nimport installPaths from './installPaths.js';\nconst DEFAULT_INSTALL_DIRECTORY = path.join(home(), '.nvu');\nconst DEFAULT_INSTALL_DIRECTORIES = installPaths(DEFAULT_INSTALL_DIRECTORY);\n\nimport Module from 'module';\nimport lazy from 'lazy-cache';\nconst _require = typeof require === 'undefined' ? Module.createRequire(import.meta.url) : require;\nconst resolveVersions = lazy(_require)('node-resolve-versions');\nconst installRelease = lazy(_require)('node-install-release');\n\nimport type { InstallOptions, InstallResult } from './types.js';\n\nexport default function worker(versionExpression: string, options: InstallOptions, callback) {\n const { buildPath, cachePath, installPath: rootInstallPath } = options.installPath ? installPaths(options.installPath) : DEFAULT_INSTALL_DIRECTORIES;\n\n resolveVersions()(versionExpression, { ...options }, (err, versions) => {\n if (err) return callback(err);\n if (!versions.length) return callback(new Error(`No versions found from expression: ${versionExpression}`));\n\n const results: InstallResult[] = [];\n const queue = new Queue(options.concurrency || 1);\n versions.forEach((version) =>\n queue.defer((callback) => {\n const installPath = path.join(rootInstallPath, version);\n const binRoot = isWindows ? installPath : path.join(installPath, 'bin');\n const execPath = path.join(binRoot, NODE);\n\n function done(err?) {\n if (err) return callback(err);\n results.push({ version, installPath, execPath });\n callback();\n }\n\n fs.stat(execPath, (err) => {\n // TODO remove redundant options\n err ? installRelease()(version, installPath, { cachePath, buildPath
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-version-install/src/worker.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport { NODE, isWindows } from './constants.js';\n\nimport home from 'homedir-polyfill';\nimport installPaths from './installPaths.js';\nconst DEFAULT_INSTALL_DIRECTORY = path.join(home(), '.nvu');\nconst DEFAULT_INSTALL_DIRECTORIES = installPaths(DEFAULT_INSTALL_DIRECTORY);\n\nimport Module from 'module';\nimport lazy from 'lazy-cache';\nconst _require = typeof require === 'undefined' ? Module.createRequire(import.meta.url) : require;\nconst resolveVersions = lazy(_require)('node-resolve-versions');\nconst installRelease = lazy(_require)('node-install-release');\n\nimport type { InstallOptions, InstallResult } from './types.js';\n\nexport default function worker(versionExpression: string, options: InstallOptions, callback) {\n const { buildPath, cachePath, installPath: rootInstallPath } = options.installPath ? installPaths(options.installPath) : DEFAULT_INSTALL_DIRECTORIES;\n\n resolveVersions()(versionExpression, { ...options }, (err, versions) => {\n if (err) return callback(err);\n if (!versions.length) return callback(new Error(`No versions found from expression: ${versionExpression}`));\n\n const results: InstallResult[] = [];\n const queue = new Queue(options.concurrency || 1);\n versions.forEach((version) =>\n queue.defer((callback) => {\n const installPath = path.join(rootInstallPath, version);\n const binRoot = isWindows ? installPath : path.join(installPath, 'bin');\n const execPath = path.join(binRoot, NODE);\n\n function done(err?) {\n if (err) return callback(err);\n results.push({ version, installPath, execPath });\n callback();\n }\n\n fs.stat(execPath, (err) => {\n // TODO remove redundant options\n err ? installRelease()(version, installPath, { cachePath, buildPath }, done) : done();\n });\n })\n );\n queue.await((err) => {\n if (err) return callback(err);\n const result = versions.length === 1 ? results[0] : results;\n callback(null, result);\n });\n });\n}\n"],"names":["worker","DEFAULT_INSTALL_DIRECTORY","path","join","home","DEFAULT_INSTALL_DIRECTORIES","installPaths","_require","require","Module","createRequire","resolveVersions","lazy","installRelease","versionExpression","options","callback","installPath","buildPath","cachePath","rootInstallPath","err","versions","length","Error","results","queue","Queue","concurrency","forEach","version","defer","done","push","execPath","binRoot","isWindows","NODE","fs","stat","await","result"],"mappings":";;;;+BAkBA;;;eAAwBA;;;yDAlBT;2DACE;8DACC;yBACc;sEAEf;mEACQ;6DAIN;gEACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAJjB,IAAMC,4BAA4BC,aAAI,CAACC,IAAI,CAACC,IAAAA,wBAAI,KAAI;AACpD,IAAMC,8BAA8BC,IAAAA,qBAAY,EAACL;AAIjD,IAAMM,WAAW,OAAOC,YAAY,cAAcC,eAAM,CAACC,aAAa,CAAC,uDAAmBF;AAC1F,IAAMG,kBAAkBC,IAAAA,kBAAI,EAACL,UAAU;AACvC,IAAMM,iBAAiBD,IAAAA,kBAAI,EAACL,UAAU;AAIvB,SAASP,OAAOc,iBAAyB,EAAEC,OAAuB,EAAEC,QAAQ;IACzF,IAA+DD,OAAAA,QAAQE,WAAW,GAAGX,IAAAA,qBAAY,EAACS,QAAQE,WAAW,IAAIZ,6BAAjHa,YAAuDH,KAAvDG,WAAWC,YAA4CJ,KAA5CI,WAAWF,AAAaG,kBAAoBL,KAAjCE;IAE9BN,kBAAkBG,mBAAmB,mBAAKC,UAAW,SAACM,KAAKC;QACzD,IAAID,KAAK,OAAOL,SAASK;QACzB,IAAI,CAACC,SAASC,MAAM,EAAE,OAAOP,SAAS,IAAIQ,MAAM,AAAC,sCAAuD,OAAlBV;QAEtF,IAAMW,UAA2B,EAAE;QACnC,IAAMC,QAAQ,IAAIC,gBAAK,CAACZ,QAAQa,WAAW,IAAI;QAC/CN,SAASO,OAAO,CAAC,SAACC;mBAChBJ,MAAMK,KAAK,CAAC,SAACf;oBAKFgB,OAAT,SAASA,KAAKX,GAAI;oBAChB,IAAIA,KAAK,OAAOL,SAASK;oBACzBI,QAAQQ,IAAI,CAAC;wBAAEH,SAAAA;wBAASb,aAAAA;wBAAaiB,UAAAA;oBAAS;oBAC9ClB;gBACF;gBARA,IAAMC,cAAcf,aAAI,CAACC,IAAI,CAACiB,iBAAiBU;gBAC/C,IAAMK,UAAUC,oBAAS,GAAGnB,cAAcf,aAAI,CAACC,IAAI,CAACc,aAAa;gBACjE,IAAMiB,WAAWhC,aAAI,CAACC,IAAI,CAACgC,SAASE,eAAI;gBAQxCC,WAAE,CAACC,IAAI,CAACL,UAAU,SAACb;oBACjB,gCAAgC;oBAChCA,MAAMR,iBAAiBiB,SAASb,aAAa;wBAAEE,WAAAA;wBAAWD,WAAAA;oBAAU,GAAGc,QAAQA;gBACjF;YACF;;QAEFN,MAAMc,KAAK,CAAC,SAACnB;YACX,IAAIA,KAAK,OAAOL,SAASK;YACzB,IAAMoB,SAASnB,SAASC,MAAM,KAAK,IAAIE,OAAO,CAAC,EAAE,GAAGA;YACpDT,SAAS,MAAMyB;QACjB;IACF;AACF"}
|
package/dist/esm/worker.mjs
CHANGED
|
@@ -37,9 +37,7 @@ export default function worker(versionExpression, options, callback) {
|
|
|
37
37
|
// TODO remove redundant options
|
|
38
38
|
err ? installRelease()(version, installPath, {
|
|
39
39
|
cachePath,
|
|
40
|
-
buildPath
|
|
41
|
-
cacheDirectory: cachePath,
|
|
42
|
-
buildDirectory: buildPath
|
|
40
|
+
buildPath
|
|
43
41
|
}, done) : done();
|
|
44
42
|
});
|
|
45
43
|
}));
|
package/dist/esm/worker.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-version-install/src/worker.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport { NODE, isWindows } from './constants.js';\n\nimport home from 'homedir-polyfill';\nimport installPaths from './installPaths.js';\nconst DEFAULT_INSTALL_DIRECTORY = path.join(home(), '.nvu');\nconst DEFAULT_INSTALL_DIRECTORIES = installPaths(DEFAULT_INSTALL_DIRECTORY);\n\nimport Module from 'module';\nimport lazy from 'lazy-cache';\nconst _require = typeof require === 'undefined' ? Module.createRequire(import.meta.url) : require;\nconst resolveVersions = lazy(_require)('node-resolve-versions');\nconst installRelease = lazy(_require)('node-install-release');\n\nimport type { InstallOptions, InstallResult } from './types.js';\n\nexport default function worker(versionExpression: string, options: InstallOptions, callback) {\n const { buildPath, cachePath, installPath: rootInstallPath } = options.installPath ? installPaths(options.installPath) : DEFAULT_INSTALL_DIRECTORIES;\n\n resolveVersions()(versionExpression, { ...options }, (err, versions) => {\n if (err) return callback(err);\n if (!versions.length) return callback(new Error(`No versions found from expression: ${versionExpression}`));\n\n const results: InstallResult[] = [];\n const queue = new Queue(options.concurrency || 1);\n versions.forEach((version) =>\n queue.defer((callback) => {\n const installPath = path.join(rootInstallPath, version);\n const binRoot = isWindows ? installPath : path.join(installPath, 'bin');\n const execPath = path.join(binRoot, NODE);\n\n function done(err?) {\n if (err) return callback(err);\n results.push({ version, installPath, execPath });\n callback();\n }\n\n fs.stat(execPath, (err) => {\n // TODO remove redundant options\n err ? installRelease()(version, installPath, { cachePath, buildPath
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-version-install/src/worker.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport { NODE, isWindows } from './constants.js';\n\nimport home from 'homedir-polyfill';\nimport installPaths from './installPaths.js';\nconst DEFAULT_INSTALL_DIRECTORY = path.join(home(), '.nvu');\nconst DEFAULT_INSTALL_DIRECTORIES = installPaths(DEFAULT_INSTALL_DIRECTORY);\n\nimport Module from 'module';\nimport lazy from 'lazy-cache';\nconst _require = typeof require === 'undefined' ? Module.createRequire(import.meta.url) : require;\nconst resolveVersions = lazy(_require)('node-resolve-versions');\nconst installRelease = lazy(_require)('node-install-release');\n\nimport type { InstallOptions, InstallResult } from './types.js';\n\nexport default function worker(versionExpression: string, options: InstallOptions, callback) {\n const { buildPath, cachePath, installPath: rootInstallPath } = options.installPath ? installPaths(options.installPath) : DEFAULT_INSTALL_DIRECTORIES;\n\n resolveVersions()(versionExpression, { ...options }, (err, versions) => {\n if (err) return callback(err);\n if (!versions.length) return callback(new Error(`No versions found from expression: ${versionExpression}`));\n\n const results: InstallResult[] = [];\n const queue = new Queue(options.concurrency || 1);\n versions.forEach((version) =>\n queue.defer((callback) => {\n const installPath = path.join(rootInstallPath, version);\n const binRoot = isWindows ? installPath : path.join(installPath, 'bin');\n const execPath = path.join(binRoot, NODE);\n\n function done(err?) {\n if (err) return callback(err);\n results.push({ version, installPath, execPath });\n callback();\n }\n\n fs.stat(execPath, (err) => {\n // TODO remove redundant options\n err ? installRelease()(version, installPath, { cachePath, buildPath }, done) : done();\n });\n })\n );\n queue.await((err) => {\n if (err) return callback(err);\n const result = versions.length === 1 ? results[0] : results;\n callback(null, result);\n });\n });\n}\n"],"names":["fs","path","Queue","NODE","isWindows","home","installPaths","DEFAULT_INSTALL_DIRECTORY","join","DEFAULT_INSTALL_DIRECTORIES","Module","lazy","_require","require","createRequire","url","resolveVersions","installRelease","worker","versionExpression","options","callback","buildPath","cachePath","installPath","rootInstallPath","err","versions","length","Error","results","queue","concurrency","forEach","version","defer","binRoot","execPath","done","push","stat","await","result"],"mappings":"AAAA,OAAOA,QAAQ,KAAK;AACpB,OAAOC,UAAU,OAAO;AACxB,OAAOC,WAAW,WAAW;AAC7B,SAASC,IAAI,EAAEC,SAAS,QAAQ,iBAAiB;AAEjD,OAAOC,UAAU,mBAAmB;AACpC,OAAOC,kBAAkB,oBAAoB;AAC7C,MAA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GAAGgB,QAAQA;gBACjF;YACF;QAEFP,MAAMU,KAAK,CAAC,CAACf;YACX,IAAIA,KAAK,OAAOL,SAASK;YACzB,MAAMgB,SAASf,SAASC,MAAM,KAAK,IAAIE,OAAO,CAAC,EAAE,GAAGA;YACpDT,SAAS,MAAMqB;QACjB;IACF;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-version-install",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Install NodeJs by version string asynchronously or synchronously",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"node",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"homedir-polyfill": "^1.0.3",
|
|
52
52
|
"lazy-cache": "^2.0.2",
|
|
53
53
|
"module-root-sync": "^0.1.1",
|
|
54
|
-
"node-install-release": "^1.
|
|
54
|
+
"node-install-release": "^1.6.0",
|
|
55
55
|
"node-resolve-versions": "^1.0.5",
|
|
56
56
|
"queue-cb": "^1.4.4"
|
|
57
57
|
},
|