node-version-use 1.3.6 → 1.4.0

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/cli.cjs CHANGED
@@ -9,6 +9,7 @@ Object.defineProperty(exports, "default", {
9
9
  }
10
10
  });
11
11
  var _exit = /*#__PURE__*/ _interop_require_default(require("exit"));
12
+ var _figures = /*#__PURE__*/ _interop_require_default(require("figures"));
12
13
  var _getoptscompat = /*#__PURE__*/ _interop_require_default(require("getopts-compat"));
13
14
  var _index = /*#__PURE__*/ _interop_require_default(require("./index.cjs"));
14
15
  function _interop_require_default(obj) {
@@ -58,13 +59,10 @@ var _default = function(argv, name) {
58
59
  });
59
60
  if (!options.silent) {
60
61
  console.log('\n======================');
61
- if (errors.length) {
62
- console.log("Errors ".concat(errors.length, " and successes ").concat(results.length - errors.length));
63
- errors.forEach(function(result) {
64
- return console.log("".concat(result.command, " Error: ").concat(result.error.message));
65
- });
66
- } else console.log("Success (".concat(results.length, ")"));
67
- console.log('======================');
62
+ console.log("nvu ".concat(args.join(' '), " ").concat(errors.length ? 'failed' : 'succeeed'));
63
+ results.forEach(function(res) {
64
+ return console.log("".concat(res.error ? _figures.default.cross : _figures.default.tick, " ").concat(res.version).concat(res.error ? " Error: ".concat(res.error.message) : ''));
65
+ });
68
66
  }
69
67
  (0, _exit.default)(errors.length ? -1 : 0);
70
68
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-version-use/src/cli.js"],"sourcesContent":["import exit from 'exit';\nimport getopts from 'getopts-compat';\nimport nvu from './index.mjs';\n\nexport default (argv, name) => {\n const options = getopts(argv.slice(1), {\n alias: { range: 'r', desc: 'd', silent: 's' },\n default: { range: 'major,even' },\n boolean: ['silent', 'desc'],\n stopEarly: true,\n });\n\n // define.option('-r, --range [range]', 'range type of major, minor, or patch with filters of lts, even, odd for version string expressions', 'major,even');\n // define.option('-s, --silent', 'suppress logging', false);\n options.sort = options.desc ? -1 : 1;\n\n const args = argv.slice(0, 1).concat(options._);\n if (args.length < 1) {\n console.log(`Missing command. Example usage: ${name} [version expression] [command]`);\n return exit(-1);\n }\n\n if (!options.silent)\n options.header = (version, command, args) => {\n console.log('\\n----------------------');\n console.log(`${[command].concat(args).join(' ')} (${version})`);\n console.log('----------------------');\n };\n\n options.stdio = 'inherit'; // pass through stdio\n nvu(args[0], args[1], args.slice(2), options, (err, results) => {\n if (err && err.message.indexOf('ExperimentalWarning') < 0) {\n console.log(err.message);\n return exit(err.code || -1);\n }\n const errors = results.filter((result) => !!result.error);\n\n if (!options.silent) {\n console.log('\\n======================');\n if (errors.length) {\n console.log(`Errors ${errors.length} and successes ${results.length - errors.length}`);\n errors.forEach((result) => console.log(`${result.command} Error: ${result.error.message}`));\n } else console.log(`Success (${results.length})`);\n console.log('======================');\n }\n\n exit(errors.length ? -1 : 0);\n });\n};\n"],"names":["argv","name","options","getopts","slice","alias","range","desc","silent","default","boolean","stopEarly","sort","args","concat","_","length","console","log","exit","header","version","command","join","stdio","nvu","err","results","message","indexOf","code","errors","filter","result","error","forEach"],"mappings":";;;;+BAIA;;;eAAA;;;2DAJiB;oEACG;4DACJ;;;;;;IAEhB,WAAe,SAACA,MAAMC;IACpB,IAAMC,UAAUC,IAAAA,sBAAO,EAACH,KAAKI,KAAK,CAAC,IAAI;QACrCC,OAAO;YAAEC,OAAO;YAAKC,MAAM;YAAKC,QAAQ;QAAI;QAC5CC,SAAS;YAAEH,OAAO;QAAa;QAC/BI,SAAS;YAAC;YAAU;SAAO;QAC3BC,WAAW;IACb;IAEA,4JAA4J;IAC5J,4DAA4D;IAC5DT,QAAQU,IAAI,GAAGV,QAAQK,IAAI,GAAG,CAAC,IAAI;IAEnC,IAAMM,OAAOb,KAAKI,KAAK,CAAC,GAAG,GAAGU,MAAM,CAACZ,QAAQa,CAAC;IAC9C,IAAIF,KAAKG,MAAM,GAAG,GAAG;QACnBC,QAAQC,GAAG,CAAC,AAAC,mC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ACY,OAAOf,MAAM,GAAG,CAAC,IAAI;IAC5B;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-version-use/src/cli.js"],"sourcesContent":["import exit from 'exit';\nimport figures from 'figures';\nimport getopts from 'getopts-compat';\nimport nvu from './index.mjs';\n\nexport default (argv, name) => {\n const options = getopts(argv.slice(1), {\n alias: { range: 'r', desc: 'd', silent: 's' },\n default: { range: 'major,even' },\n boolean: ['silent', 'desc'],\n stopEarly: true,\n });\n\n // define.option('-r, --range [range]', 'range type of major, minor, or patch with filters of lts, even, odd for version string expressions', 'major,even');\n // define.option('-s, --silent', 'suppress logging', false);\n options.sort = options.desc ? -1 : 1;\n\n const args = argv.slice(0, 1).concat(options._);\n if (args.length < 1) {\n console.log(`Missing command. Example usage: ${name} [version expression] [command]`);\n return exit(-1);\n }\n\n if (!options.silent)\n options.header = (version, command, args) => {\n console.log('\\n----------------------');\n console.log(`${[command].concat(args).join(' ')} (${version})`);\n console.log('----------------------');\n };\n\n options.stdio = 'inherit'; // pass through stdio\n nvu(args[0], args[1], args.slice(2), options, (err, results) => {\n if (err && err.message.indexOf('ExperimentalWarning') < 0) {\n console.log(err.message);\n return exit(err.code || -1);\n }\n const errors = results.filter((result) => !!result.error);\n\n if (!options.silent) {\n console.log('\\n======================');\n console.log(`nvu ${args.join(' ')} ${errors.length ? 'failed' : 'succeeed'}`);\n results.forEach((res) => console.log(`${res.error ? figures.cross : figures.tick} ${res.version}${res.error ? ` Error: ${res.error.message}` : ''}`));\n }\n\n exit(errors.length ? -1 : 0);\n });\n};\n"],"names":["argv","name","options","getopts","slice","alias","range","desc","silent","default","boolean","stopEarly","sort","args","concat","_","length","console","log","exit","header","version","command","join","stdio","nvu","err","results","message","indexOf","code","errors","filter","result","error","forEach","res","figures","cross","tick"],"mappings":";;;;+BAKA;;;eAAA;;;2DALiB;8DACG;oEACA;4DACJ;;;;;;IAEhB,WAAe,SAACA,MAAMC;IACpB,IAAMC,UAAUC,IAA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,CAAC;YACZD,QAAQC,GAAG,CAAC,AAAC,OAAwBa,OAAlBlB,KAAKU,IAAI,CAAC,MAAK,KAAyC,OAAtCQ,OAAOf,MAAM,GAAG,WAAW;YAChEW,QAAQQ,OAAO,CAAC,SAACC;uBAAQnB,QAAQC,GAAG,CAAC,AAAC,GAA8CkB,OAA5CA,IAAIF,KAAK,GAAGG,gBAAO,CAACC,KAAK,GAAGD,gBAAO,CAACE,IAAI,EAAC,KAAiBH,OAAdA,IAAIf,OAAO,EAAmD,OAAhDe,IAAIF,KAAK,GAAG,AAAC,WAA4B,OAAlBE,IAAIF,KAAK,CAACN,OAAO,IAAK;;QACjJ;QAEAT,IAAAA,aAAI,EAACY,OAAOf,MAAM,GAAG,CAAC,IAAI;IAC5B;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-version-use",
3
- "version": "1.3.6",
3
+ "version": "1.4.0",
4
4
  "description": "Cross-platform solution for using multiple versions of node. Useful for compatibility testing",
5
5
  "keywords": [
6
6
  "node",
@@ -37,19 +37,20 @@
37
37
  "dependencies": {
38
38
  "cross-spawn-cb": "^2.0.13",
39
39
  "exit": "^0.1.2",
40
+ "figures": "^6.1.0",
40
41
  "getopts-compat": "^2.2.5",
41
42
  "homedir-polyfill": "^1.0.3",
42
43
  "node-resolve-versions": "^1.0.10",
43
- "node-version-install": "^1.0.6",
44
+ "node-version-install": "^1.1.0",
44
45
  "node-version-utils": "^1.2.4",
45
- "queue-cb": "^1.4.9"
46
+ "queue-cb": "^1.4.10"
46
47
  },
47
48
  "devDependencies": {
48
49
  "@biomejs/biome": "^1.9.4",
49
50
  "@types/mocha": "^10.0.10",
50
- "@types/node": "^22.10.2",
51
+ "@types/node": "^22.10.5",
51
52
  "cr": "^0.1.0",
52
- "is-version": "^0.2.1",
53
+ "is-version": "^0.2.5",
53
54
  "pinkie-promise": "^2.0.1",
54
55
  "rimraf2": "^2.8.2"
55
56
  },