node-semvers 1.5.16 → 1.6.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/NodeVersions.d.cts +3 -1
- package/dist/cjs/NodeVersions.d.ts +3 -1
- package/dist/cjs/NodeVersions.js +1 -1
- package/dist/cjs/NodeVersions.js.map +1 -1
- package/dist/cjs/assets/constants.cjs +1 -1
- package/dist/cjs/assets/postinstall.cjs +1 -1
- package/dist/cjs/assets/postinstall.cjs.map +1 -1
- package/dist/cjs/cli.d.cts +1 -1
- package/dist/cjs/cli.d.ts +1 -1
- package/dist/cjs/cli.js +1 -1
- package/dist/cjs/cli.js.map +1 -1
- package/dist/cjs/constants.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/lib/isNaN.js +1 -1
- package/dist/cjs/lib/keyFunctions.js +1 -1
- package/dist/cjs/lib/lineFunctions.js +1 -1
- package/dist/cjs/lib/match.js +1 -1
- package/dist/cjs/lib/normalizeSchedule.js +1 -1
- package/dist/cjs/lib/normalizeVersion.js +1 -1
- package/dist/cjs/parseExpression/index.js +1 -1
- package/dist/cjs/parseExpression/isLTSFn.js +1 -1
- package/dist/cjs/parseExpression/isLatestFn.js +1 -1
- package/dist/cjs/parseExpression/schedulesLatest.js +1 -1
- package/dist/cjs/types.js +1 -1
- package/dist/esm/NodeVersions.d.ts +3 -1
- package/dist/esm/NodeVersions.js.map +1 -1
- package/dist/esm/assets/postinstall.cjs.map +1 -1
- package/dist/esm/cli.d.ts +1 -1
- package/dist/esm/cli.js.map +1 -1
- package/package.json +14 -14
|
@@ -4,7 +4,9 @@ export default class NodeVersions {
|
|
|
4
4
|
versions: Version[];
|
|
5
5
|
schedules: Schedule[];
|
|
6
6
|
constructor(versions: VersionRaw[], schedule: ScheduleRaw[]);
|
|
7
|
-
static load(
|
|
7
|
+
static load(callback: LoadCallback): void;
|
|
8
|
+
static load(options: LoadOptions, callback: LoadCallback): void;
|
|
9
|
+
static load(options?: LoadOptions): Promise<NodeVersions>;
|
|
8
10
|
static loadSync(options?: LoadOptions): NodeVersions | null;
|
|
9
11
|
resolve(expression: string | number | Date, options?: ResolveOptions): string | string[] | Version | Version[] | null;
|
|
10
12
|
}
|
|
@@ -4,7 +4,9 @@ export default class NodeVersions {
|
|
|
4
4
|
versions: Version[];
|
|
5
5
|
schedules: Schedule[];
|
|
6
6
|
constructor(versions: VersionRaw[], schedule: ScheduleRaw[]);
|
|
7
|
-
static load(
|
|
7
|
+
static load(callback: LoadCallback): void;
|
|
8
|
+
static load(options: LoadOptions, callback: LoadCallback): void;
|
|
9
|
+
static load(options?: LoadOptions): Promise<NodeVersions>;
|
|
8
10
|
static loadSync(options?: LoadOptions): NodeVersions | null;
|
|
9
11
|
resolve(expression: string | number | Date, options?: ResolveOptions): string | string[] | Version | Version[] | null;
|
|
10
12
|
}
|
package/dist/cjs/NodeVersions.js
CHANGED
|
@@ -122,4 +122,4 @@ var NodeVersions = /*#__PURE__*/ function() {
|
|
|
122
122
|
};
|
|
123
123
|
return NodeVersions;
|
|
124
124
|
}();
|
|
125
|
-
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (
|
|
125
|
+
/* 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":["/Users/kevin/Dev/OpenSource/node-version/node-semvers/src/NodeVersions.ts"],"sourcesContent":["import Cache from 'fetch-json-cache';\nimport semver from 'semver';\n\nimport { CACHE_PATH, DISTS_URL, SCHEDULES_URL } from './constants.ts';\nimport { major, minor } from './lib/keyFunctions.ts';\nimport { even, odd } from './lib/lineFunctions.ts';\nimport match from './lib/match.ts';\nimport normalizeSchedule from './lib/normalizeSchedule.ts';\nimport normalizeVersion from './lib/normalizeVersion.ts';\nimport parseExpression from './parseExpression/index.ts';\n\nimport type { LoadError, LoadOptions, ResolveOptions, Schedule, ScheduleRaw, Version, VersionRaw } from './types.ts';\n\nexport type LoadCallback = (error?: LoadError, semvers?: NodeVersions) => void;\n\nexport default class NodeVersions {\n versions: Version[];\n schedules: Schedule[];\n\n constructor(versions: VersionRaw[], schedule: ScheduleRaw[]) {\n if (!versions) throw new Error('Missing option: versions');\n if (!schedule) throw new Error('Missing option: schedule');\n\n this.schedules = [];\n for (const name in schedule) this.schedules.push(normalizeSchedule(name, schedule[name]));\n this.schedules = this.schedules.sort((a, b) => (semver.gt(semver.coerce(a.semver), semver.coerce(b.semver)) ? 1 : -1));\n\n this.versions = [];\n for (let index = 0; index < versions.length; index++) this.versions.push(normalizeVersion(versions[index], this.schedules));\n this.versions = this.versions.sort((a, b) => (semver.gt(a.semver, b.semver) ? -1 : 1));\n }\n\n static load(options?: LoadOptions | LoadCallback, callback?: LoadCallback):
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-semvers/src/NodeVersions.ts"],"sourcesContent":["import Cache from 'fetch-json-cache';\nimport semver from 'semver';\n\nimport { CACHE_PATH, DISTS_URL, SCHEDULES_URL } from './constants.ts';\nimport { major, minor } from './lib/keyFunctions.ts';\nimport { even, odd } from './lib/lineFunctions.ts';\nimport match from './lib/match.ts';\nimport normalizeSchedule from './lib/normalizeSchedule.ts';\nimport normalizeVersion from './lib/normalizeVersion.ts';\nimport parseExpression from './parseExpression/index.ts';\n\nimport type { LoadError, LoadOptions, ResolveOptions, Schedule, ScheduleRaw, Version, VersionRaw } from './types.ts';\n\nexport type LoadCallback = (error?: LoadError, semvers?: NodeVersions) => void;\n\nexport default class NodeVersions {\n versions: Version[];\n schedules: Schedule[];\n\n constructor(versions: VersionRaw[], schedule: ScheduleRaw[]) {\n if (!versions) throw new Error('Missing option: versions');\n if (!schedule) throw new Error('Missing option: schedule');\n\n this.schedules = [];\n for (const name in schedule) this.schedules.push(normalizeSchedule(name, schedule[name]));\n this.schedules = this.schedules.sort((a, b) => (semver.gt(semver.coerce(a.semver), semver.coerce(b.semver)) ? 1 : -1));\n\n this.versions = [];\n for (let index = 0; index < versions.length; index++) this.versions.push(normalizeVersion(versions[index], this.schedules));\n this.versions = this.versions.sort((a, b) => (semver.gt(a.semver, b.semver) ? -1 : 1));\n }\n\n static load(callback: LoadCallback): void;\n static load(options: LoadOptions, callback: LoadCallback): void;\n static load(options?: LoadOptions): Promise<NodeVersions>;\n static load(options?: LoadOptions | LoadCallback, callback?: LoadCallback): void | Promise<NodeVersions> {\n if (typeof options === 'function') {\n callback = options;\n options = null;\n }\n options = options || {};\n\n function worker(options, callback) {\n const cache = new Cache((options as LoadOptions).cachePath || CACHE_PATH);\n cache.get<VersionRaw[]>(DISTS_URL, (err, versions): void => {\n if (err) return callback(err);\n\n cache.get(SCHEDULES_URL, (err, schedule: ScheduleRaw[]) => {\n err ? callback(err) : callback(null, new NodeVersions(versions, schedule));\n });\n });\n }\n\n if (typeof callback === 'function') return worker(options, callback);\n return new Promise((resolve, reject) => worker(options, (err, versions) => (err ? reject(err) : resolve(versions))));\n }\n\n static loadSync(options?: LoadOptions): NodeVersions | null {\n options = options || {};\n const cache = new Cache(options.cachePath || CACHE_PATH);\n const versions = cache.getSync<VersionRaw[]>(DISTS_URL);\n const schedule = cache.getSync<ScheduleRaw[]>(SCHEDULES_URL);\n if (!versions || !schedule) return null;\n return new NodeVersions(versions, schedule);\n }\n\n resolve(expression: string | number | Date, options?: ResolveOptions): string | string[] | Version | Version[] | null {\n options = options || {};\n const path = options.path || 'version';\n\n // normalize\n if (typeof expression === 'number') expression = `${expression}`;\n if (typeof expression !== 'string') return null;\n expression = expression.trim();\n\n // single result, try a match\n const query = parseExpression.call(this, expression, options.now || new Date());\n if (query) {\n let version = null;\n for (let index = 0; index < this.versions.length; index++) {\n const test = this.versions[index];\n if (options.now && options.now < test.date) continue;\n if (!match(test, query)) continue;\n version = test;\n break;\n }\n if (version) return version[path];\n }\n\n // filtered expression\n const range = options.range || '';\n const filters = { lts: !!~range.indexOf('lts'), key: undefined, line: undefined };\n filters.key = ~range.indexOf('major') ? major : ~range.indexOf('minor') ? minor : undefined;\n filters.line = ~range.indexOf('even') ? even : ~range.indexOf('odd') ? odd : undefined;\n\n const results = [];\n const founds = {};\n\n for (let index = 0; index < this.versions.length; index++) {\n const test = this.versions[index];\n if (options.now && options.now < test.date) continue;\n if (filters.lts && !test.lts) continue;\n if (filters.line && !filters.line(test)) continue;\n if (!semver.satisfies(test.semver, expression)) continue;\n if (filters.key) {\n if (founds[filters.key(test)]) continue;\n founds[filters.key(test)] = true;\n }\n results.unshift(test[path]);\n }\n return results;\n }\n}\n"],"names":["NodeVersions","versions","schedule","Error","schedules","name","push","normalizeSchedule","sort","a","b","semver","gt","coerce","index","length","normalizeVersion","resolve","expression","options","path","trim","query","parseExpression","call","now","Date","version","test","date","match","range","filters","lts","indexOf","key","undefined","line","major","minor","even","odd","results","founds","satisfies","unshift","load","callback","worker","cache","Cache","cachePath","CACHE_PATH","get","DISTS_URL","err","SCHEDULES_URL","Promise","reject","loadSync","getSync"],"mappings":";;;;;;;eAeqBA;;;qEAfH;6DACC;2BAEkC;8BACxB;+BACH;8DACR;0EACY;yEACD;8DACD;;;;;;;;;;;AAMb,IAAA,AAAMA,6BAAN;;aAAMA,aAIPC,QAAsB,EAAEC,QAAuB;gCAJxCF;QAKjB,IAAI,CAACC,UAAU,MAAM,IAAIE,MAAM;QAC/B,IAAI,CAACD,UAAU,MAAM,IAAIC,MAAM;QAE/B,IAAI,CAACC,SAAS,GAAG,EAAE;QACnB,IAAK,IAAMC,QAAQH,SAAU,IAAI,CAACE,SAAS,CAACE,IAAI,CAACC,IAAAA,4BAAiB,EAACF,MAAMH,QAAQ,CAACG,KAAK;QACvF,IAAI,CAACD,SAAS,GAAG,IAAI,CAACA,SAAS,CAACI,IAAI,CAAC,SAACC,GAAGC;mBAAOC,eAAM,CAACC,EAAE,CAACD,eAA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Z;QACAA,UAAUA,WAAW,CAAC;QAEtB,SAAS6B,OAAO7B,OAAO,EAAE4B,QAAQ;YAC/B,IAAME,QAAQ,IAAIC,uBAAK,CAAC,AAAC/B,QAAwBgC,SAAS,IAAIC,uBAAU;YACxEH,MAAMI,GAAG,CAAeC,sBAAS,EAAE,SAACC,KAAKtD;gBACvC,IAAIsD,KAAK,OAAOR,SAASQ;gBAEzBN,MAAMI,GAAG,CAACG,0BAAa,EAAE,SAACD,KAAKrD;oBAC7BqD,MAAMR,SAASQ,OAAOR,SAAS,MAAM,IAjC1B/C,aAiC2CC,UAAUC;gBAClE;YACF;QACF;QAEA,IAAI,OAAO6C,aAAa,YAAY,OAAOC,OAAO7B,SAAS4B;QAC3D,OAAO,IAAIU,QAAQ,SAACxC,SAASyC;mBAAWV,OAAO7B,SAAS,SAACoC,KAAKtD;uBAAcsD,MAAMG,OAAOH,OAAOtC,QAAQhB;;;IAC1G;IAxCmBD,aA0CZ2D,QAON,GAPD,SAAOA,SAASxC,OAAqB;QACnCA,UAAUA,WAAW,CAAC;QACtB,IAAM8B,QAAQ,IAAIC,uBAAK,CAAC/B,QAAQgC,SAAS,IAAIC,uBAAU;QACvD,IAAMnD,WAAWgD,MAAMW,OAAO,CAAeN,sBAAS;QACtD,IAAMpD,WAAW+C,MAAMW,OAAO,CAAgBJ,0BAAa;QAC3D,IAAI,CAACvD,YAAY,CAACC,UAAU,OAAO;QACnC,OAAO,IAhDUF,aAgDOC,UAAUC;IACpC;WAjDmBF"}
|
|
@@ -5,4 +5,4 @@ module.exports = {
|
|
|
5
5
|
DISTS_URL: 'https://nodejs.org/dist/index.json',
|
|
6
6
|
SCHEDULES_URL: 'https://raw.githubusercontent.com/nodejs/Release/master/schedule.json'
|
|
7
7
|
};
|
|
8
|
-
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (
|
|
8
|
+
/* 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; }
|
|
@@ -33,4 +33,4 @@ cacheWithRetry(function(err) {
|
|
|
33
33
|
exit(0);
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
|
-
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (
|
|
36
|
+
/* 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":["/Users/kevin/Dev/OpenSource/node-version/node-semvers/src/assets/postinstall.cts"],"sourcesContent":["const exit = require('exit-compat');\nconst Cache = require('fetch-json-cache');\nconst { CACHE_PATH, DISTS_URL, SCHEDULES_URL } = require('./constants.cts');\n\ntype Callback = (err: Error | null) => void;\n\nfunction fetchWithRetry(cache: typeof Cache.prototype, url: string, retries: number, callback: Callback)
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-semvers/src/assets/postinstall.cts"],"sourcesContent":["const exit = require('exit-compat');\nconst Cache = require('fetch-json-cache');\nconst { CACHE_PATH, DISTS_URL, SCHEDULES_URL } = require('./constants.cts');\n\ntype Callback = (err: Error | null) => void;\n\nfunction fetchWithRetry(cache: typeof Cache.prototype, url: string, retries: number, callback: Callback) {\n cache.get(url, { force: true }, (err: Error | null) => {\n if (err && retries > 0) {\n setTimeout(() => {\n fetchWithRetry(cache, url, retries - 1, callback);\n }, 1000);\n } else {\n callback(err);\n }\n });\n}\n\nfunction cacheWithRetry(callback: Callback) {\n const cache = new Cache(CACHE_PATH);\n fetchWithRetry(cache, DISTS_URL, 3, (err) => {\n if (err) return callback(err);\n fetchWithRetry(cache, SCHEDULES_URL, 3, callback);\n });\n}\n\n// run patch\ncacheWithRetry((err) => {\n if (err) {\n console.log(`postinstall warning: ${err.message}`);\n console.log('Cache not updated after retries.');\n exit(0);\n } else {\n console.log('postinstall succeeded');\n exit(0);\n }\n});\n"],"names":["exit","require","Cache","CACHE_PATH","DISTS_URL","SCHEDULES_URL","fetchWithRetry","cache","url","retries","callback","get","force","err","setTimeout","cacheWithRetry","console","log","message"],"mappings":";AAAA,IAAMA,OAAOC,QAAQ;AACrB,IAAMC,QAAQD,QAAQ;AACtB,IAAiDA,WAAAA,QAAQ,oBAAjDE,aAAyCF,SAAzCE,YAAYC,YAA6BH,SAA7BG,WAAWC,gBAAkBJ,SAAlBI;AAI/B,SAASC,eAAeC,KAA6B,EAAEC,GAAW,EAAEC,OAAe,EAAEC,QAAkB;IACrGH,MAAMI,GAAG,CAACH,KAAK;QAAEI,OAAO;IAAK,GAAG,SAACC;QAC/B,IAAIA,OAAOJ,UAAU,GAAG;YACtBK,WAAW;gBACTR,eAAeC,OAAOC,KAAKC,UAAU,GAAGC;YAC1C,GAAG;QACL,OAAO;YACLA,SAASG;QACX;IACF;AACF;AAEA,SAASE,eAAeL,QAAkB;IACxC,IAAMH,QAAQ,IAAIL,MAAMC;IACxBG,eAAeC,OAAOH,WAAW,GAAG,SAACS;QACnC,IAAIA,KAAK,OAAOH,SAASG;QACzBP,eAAeC,OAAOF,eAAe,GAAGK;IAC1C;AACF;AAEA,YAAY;AACZK,eAAe,SAACF;IACd,IAAIA,KAAK;QACPG,QAAQC,GAAG,CAAC,AAAC,wBAAmC,OAAZJ,IAAIK,OAAO;QAC/CF,QAAQC,GAAG,CAAC;QACZjB,KAAK;IACP,OAAO;QACLgB,QAAQC,GAAG,CAAC;QACZjB,KAAK;IACP;AACF"}
|
package/dist/cjs/cli.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: (argv: string[], name?: string) =>
|
|
1
|
+
declare const _default: (argv: string[], name?: string) => void;
|
|
2
2
|
export default _default;
|
package/dist/cjs/cli.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: (argv: string[], name?: string) =>
|
|
1
|
+
declare const _default: (argv: string[], name?: string) => void;
|
|
2
2
|
export default _default;
|
package/dist/cjs/cli.js
CHANGED
|
@@ -110,4 +110,4 @@ var _default = function(argv, name) {
|
|
|
110
110
|
(0, _exitcompat.default)(0);
|
|
111
111
|
});
|
|
112
112
|
};
|
|
113
|
-
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (
|
|
113
|
+
/* 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/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-semvers/src/cli.ts"],"sourcesContent":["import exit from 'exit-compat';\nimport fs from 'fs';\nimport getopts from 'getopts-compat';\nimport path from 'path';\nimport url from 'url';\nimport NodeVersions, { type LoadOptions, type ResolveOptions } from './index.ts';\n// biome-ignore lint/suspicious/noShadowRestrictedNames: Legacy\nimport isNaN from './lib/isNaN.ts';\n\nconst isArray = Array.isArray || ((x) => Object.prototype.toString.call(x) === '[object Array]');\n\nconst ERROR_CODE = 11;\nconst __dirname = path.dirname(typeof __filename !== 'undefined' ? __filename : url.fileURLToPath(import.meta.url));\n\nfunction getVersion(): string {\n const pkgPath = path.join(__dirname, '..', '..', 'package.json');\n return JSON.parse(fs.readFileSync(pkgPath, 'utf8')).version;\n}\n\nfunction printHelp(name: string): void {\n const version = getVersion();\n console.log(`${name} v${version}`);\n console.log('');\n console.log(`Usage: ${name} [options] <version-string>`);\n console.log('');\n console.log('Version Strings:');\n console.log('Any command that calls for a version can be provided any of the');\n console.log('following \"version-ish\" identifies:');\n console.log('');\n console.log('- x.y.z A specific SemVer tuple');\n console.log('- x.y Major and minor version number');\n console.log('- x Just a major version number');\n console.log('- lts The most recent LTS (long-term support) node version');\n console.log('- lts/<name> The latest in a named LTS set. (argon, boron, etc.)');\n console.log('- lts/* Same as just \"lts\"');\n console.log('- latest The most recent (non-LTS) version');\n console.log('- stable Backwards-compatible alias for \"lts\"');\n console.log('- [expression] Engine and semver module expression like \"10.1.x || >=12.0.0\"');\n console.log('');\n console.log('Options:');\n console.log(' -p, --path <path> Path within version including raw for unprocessed version');\n console.log(' -r, --range <range> Range type of major, minor, or patch with filters of lts, even, odd');\n console.log(' -n, --now <date> Use a specific time as a Date.parse');\n console.log(' -v, --version Show version number');\n console.log(' -h, --help Show this help message');\n}\n\nexport default (argv: string[], name?: string):
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-semvers/src/cli.ts"],"sourcesContent":["import exit from 'exit-compat';\nimport fs from 'fs';\nimport getopts from 'getopts-compat';\nimport path from 'path';\nimport url from 'url';\nimport NodeVersions, { type LoadOptions, type ResolveOptions } from './index.ts';\n// biome-ignore lint/suspicious/noShadowRestrictedNames: Legacy\nimport isNaN from './lib/isNaN.ts';\n\nconst isArray = Array.isArray || ((x) => Object.prototype.toString.call(x) === '[object Array]');\n\nconst ERROR_CODE = 11;\nconst __dirname = path.dirname(typeof __filename !== 'undefined' ? __filename : url.fileURLToPath(import.meta.url));\n\nfunction getVersion(): string {\n const pkgPath = path.join(__dirname, '..', '..', 'package.json');\n return JSON.parse(fs.readFileSync(pkgPath, 'utf8')).version;\n}\n\nfunction printHelp(name: string): void {\n const version = getVersion();\n console.log(`${name} v${version}`);\n console.log('');\n console.log(`Usage: ${name} [options] <version-string>`);\n console.log('');\n console.log('Version Strings:');\n console.log('Any command that calls for a version can be provided any of the');\n console.log('following \"version-ish\" identifies:');\n console.log('');\n console.log('- x.y.z A specific SemVer tuple');\n console.log('- x.y Major and minor version number');\n console.log('- x Just a major version number');\n console.log('- lts The most recent LTS (long-term support) node version');\n console.log('- lts/<name> The latest in a named LTS set. (argon, boron, etc.)');\n console.log('- lts/* Same as just \"lts\"');\n console.log('- latest The most recent (non-LTS) version');\n console.log('- stable Backwards-compatible alias for \"lts\"');\n console.log('- [expression] Engine and semver module expression like \"10.1.x || >=12.0.0\"');\n console.log('');\n console.log('Options:');\n console.log(' -p, --path <path> Path within version including raw for unprocessed version');\n console.log(' -r, --range <range> Range type of major, minor, or patch with filters of lts, even, odd');\n console.log(' -n, --now <date> Use a specific time as a Date.parse');\n console.log(' -v, --version Show version number');\n console.log(' -h, --help Show this help message');\n}\n\nexport default (argv: string[], name?: string): void => {\n const cliName = name || 'nsv';\n const options = getopts(argv, {\n alias: { path: 'p', range: 'r', now: 'n', version: 'v', help: 'h' },\n boolean: ['version', 'help'],\n });\n\n if (options.version) {\n console.log(getVersion());\n exit(0);\n return;\n }\n\n if (options.help) {\n printHelp(cliName);\n exit(0);\n return;\n }\n\n if (typeof options.now !== 'undefined') options.now = new Date(isNaN(+options.now) ? Date.parse(options.now) : +options.now);\n\n const args = options._;\n if (args.length < 1) {\n console.log(`Missing version string. Example usage: ${cliName} [version string]. Use ${cliName} --help for information on version strings`);\n exit(ERROR_CODE);\n return;\n }\n\n function stringify(value) {\n return typeof value === 'string' ? value : JSON.stringify(value);\n }\n\n NodeVersions.load(options as LoadOptions, (err, semvers) => {\n if (err) {\n console.log(err.message);\n exit(ERROR_CODE);\n return;\n }\n\n const version = semvers.resolve(args[0], options as ResolveOptions);\n if (!version || (isArray(version) && !(version as string[]).length)) {\n console.log(`Unrecognized: ${args[0]}`);\n exit(ERROR_CODE);\n return;\n }\n\n console.log('versions:');\n if (isArray(version)) {\n for (let index = 0; index < (version as string[]).length; index++) console.log(stringify(version[index]));\n } else console.log(stringify(version));\n exit(0);\n });\n};\n"],"names":["isArray","Array","x","Object","prototype","toString","call","ERROR_CODE","__dirname","path","dirname","__filename","url","fileURLToPath","getVersion","pkgPath","join","JSON","parse","fs","readFileSync","version","printHelp","name","console","log","argv","stringify","value","cliName","options","getopts","alias","range","now","help","boolean","exit","Date","isNaN","args","_","length","NodeVersions","load","err","semvers","message","resolve","index"],"mappings":";;;;+BA+CA;;;eAAA;;;iEA/CiB;yDACF;oEACK;2DACH;0DACD;8DACoD;8DAElD;;;;;;AAElB,IAAMA,UAAUC,MAAMD,OAAO,IAAK,SAACE;WAAMC,OAAOC,SAAS,CAACC,QAAQ,CAACC,IAAI,CAACJ,OAAO;;AAE/E,IAAMK,aAAa;AACnB,IAAMC,YAAYC,aAAI,CAACC,OAAO,CAAC,OAAOC,eAAe,cAAcA,aAAaC,YAAG,CAACC,aAAa,CAAC;AAElG,SAASC;IACP,IAAMC,UAAUN,aAAI,CAACO,IAAI,CAACR,WAAW,MAAM,MAAM;IACjD,OAAOS,KAAKC,KAAK,CAACC,WAAE,CAACC,YAAY,CAACL,SAAS,SAASM,OAAO;AAC7D;AAEA,SAASC,UAAUC,IAAY;IAC7B,IAAMF,UAAUP;IAChBU,QAAQC,GAAG,CAAC,AAAC,GAAWJ,OAATE,MAAK,MAAY,OAARF;IACxBG,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC,AAAC,UAAc,OAALF,MAAK;IAC3BC,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;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OAARe,IAAI,CAAC,EAAE;YACpCH,IAAAA,mBAAI,EAAC9B;YACL;QACF;QAEAiB,QAAQC,GAAG,CAAC;QACZ,IAAIzB,QAAQqB,UAAU;YACpB,IAAK,IAAI4B,QAAQ,GAAGA,QAAQ,AAAC5B,QAAqBqB,MAAM,EAAEO,QAASzB,QAAQC,GAAG,CAACE,UAAUN,OAAO,CAAC4B,MAAM;QACzG,OAAOzB,QAAQC,GAAG,CAACE,UAAUN;QAC7BgB,IAAAA,mBAAI,EAAC;IACP;AACF"}
|
package/dist/cjs/constants.js
CHANGED
|
@@ -30,4 +30,4 @@ var constants = _require('../../assets/constants.cjs');
|
|
|
30
30
|
var CACHE_PATH = constants.CACHE_PATH;
|
|
31
31
|
var DISTS_URL = constants.DISTS_URL;
|
|
32
32
|
var SCHEDULES_URL = constants.SCHEDULES_URL;
|
|
33
|
-
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (
|
|
33
|
+
/* 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/index.js
CHANGED
|
@@ -14,4 +14,4 @@ function _interop_require_default(obj) {
|
|
|
14
14
|
default: obj
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (
|
|
17
|
+
/* 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/lib/isNaN.js
CHANGED
|
@@ -13,4 +13,4 @@ function isNaN(value) {
|
|
|
13
13
|
// biome-ignore lint/suspicious/noSelfCompare: Legacy
|
|
14
14
|
return value !== value;
|
|
15
15
|
}
|
|
16
|
-
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (
|
|
16
|
+
/* 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; }
|
|
@@ -22,4 +22,4 @@ function major(version) {
|
|
|
22
22
|
function minor(version) {
|
|
23
23
|
return version.major === 0 ? "".concat(version.major, ".").concat(version.minor, ".").concat(version.patch) : "".concat(version.major, ".").concat(version.minor);
|
|
24
24
|
}
|
|
25
|
-
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (
|
|
25
|
+
/* 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; }
|
|
@@ -24,4 +24,4 @@ function odd(version) {
|
|
|
24
24
|
var major = version.major === 0 ? version.minor : version.major;
|
|
25
25
|
return major % 2 === 1;
|
|
26
26
|
}
|
|
27
|
-
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (
|
|
27
|
+
/* 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/lib/match.js
CHANGED
|
@@ -14,4 +14,4 @@ function match(test, query) {
|
|
|
14
14
|
}
|
|
15
15
|
return true;
|
|
16
16
|
}
|
|
17
|
-
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (
|
|
17
|
+
/* 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; }
|
|
@@ -21,4 +21,4 @@ function normalizeSchedule(name, raw) {
|
|
|
21
21
|
if (raw.maintenance) schedule.maintenance = new Date(raw.maintenance);
|
|
22
22
|
return schedule;
|
|
23
23
|
}
|
|
24
|
-
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (
|
|
24
|
+
/* 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; }
|
|
@@ -32,4 +32,4 @@ function normalizeVersion(raw, schedules) {
|
|
|
32
32
|
if (schedule && raw.lts) version.codename = schedule.codename;
|
|
33
33
|
return version;
|
|
34
34
|
}
|
|
35
|
-
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (
|
|
35
|
+
/* 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; }
|
|
@@ -59,4 +59,4 @@ function parseExpression(expression, now) {
|
|
|
59
59
|
codename: expression.toLowerCase()
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
|
-
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (
|
|
62
|
+
/* 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; }
|
|
@@ -13,4 +13,4 @@ function isLTSFn(now) {
|
|
|
13
13
|
return item.lts && now >= item.start && now <= item.end;
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (
|
|
16
|
+
/* 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; }
|
|
@@ -13,4 +13,4 @@ function isLatestFn(now) {
|
|
|
13
13
|
return !item.lts && now >= item.start && now <= item.end;
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (
|
|
16
|
+
/* 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; }
|
|
@@ -17,4 +17,4 @@ function schedulesLatest(schedules, filter) {
|
|
|
17
17
|
}
|
|
18
18
|
return latest;
|
|
19
19
|
}
|
|
20
|
-
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (
|
|
20
|
+
/* 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/types.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (
|
|
5
|
+
/* 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; }
|
|
@@ -4,7 +4,9 @@ export default class NodeVersions {
|
|
|
4
4
|
versions: Version[];
|
|
5
5
|
schedules: Schedule[];
|
|
6
6
|
constructor(versions: VersionRaw[], schedule: ScheduleRaw[]);
|
|
7
|
-
static load(
|
|
7
|
+
static load(callback: LoadCallback): void;
|
|
8
|
+
static load(options: LoadOptions, callback: LoadCallback): void;
|
|
9
|
+
static load(options?: LoadOptions): Promise<NodeVersions>;
|
|
8
10
|
static loadSync(options?: LoadOptions): NodeVersions | null;
|
|
9
11
|
resolve(expression: string | number | Date, options?: ResolveOptions): string | string[] | Version | Version[] | null;
|
|
10
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-semvers/src/NodeVersions.ts"],"sourcesContent":["import Cache from 'fetch-json-cache';\nimport semver from 'semver';\n\nimport { CACHE_PATH, DISTS_URL, SCHEDULES_URL } from './constants.ts';\nimport { major, minor } from './lib/keyFunctions.ts';\nimport { even, odd } from './lib/lineFunctions.ts';\nimport match from './lib/match.ts';\nimport normalizeSchedule from './lib/normalizeSchedule.ts';\nimport normalizeVersion from './lib/normalizeVersion.ts';\nimport parseExpression from './parseExpression/index.ts';\n\nimport type { LoadError, LoadOptions, ResolveOptions, Schedule, ScheduleRaw, Version, VersionRaw } from './types.ts';\n\nexport type LoadCallback = (error?: LoadError, semvers?: NodeVersions) => void;\n\nexport default class NodeVersions {\n versions: Version[];\n schedules: Schedule[];\n\n constructor(versions: VersionRaw[], schedule: ScheduleRaw[]) {\n if (!versions) throw new Error('Missing option: versions');\n if (!schedule) throw new Error('Missing option: schedule');\n\n this.schedules = [];\n for (const name in schedule) this.schedules.push(normalizeSchedule(name, schedule[name]));\n this.schedules = this.schedules.sort((a, b) => (semver.gt(semver.coerce(a.semver), semver.coerce(b.semver)) ? 1 : -1));\n\n this.versions = [];\n for (let index = 0; index < versions.length; index++) this.versions.push(normalizeVersion(versions[index], this.schedules));\n this.versions = this.versions.sort((a, b) => (semver.gt(a.semver, b.semver) ? -1 : 1));\n }\n\n static load(options?: LoadOptions | LoadCallback, callback?: LoadCallback):
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-semvers/src/NodeVersions.ts"],"sourcesContent":["import Cache from 'fetch-json-cache';\nimport semver from 'semver';\n\nimport { CACHE_PATH, DISTS_URL, SCHEDULES_URL } from './constants.ts';\nimport { major, minor } from './lib/keyFunctions.ts';\nimport { even, odd } from './lib/lineFunctions.ts';\nimport match from './lib/match.ts';\nimport normalizeSchedule from './lib/normalizeSchedule.ts';\nimport normalizeVersion from './lib/normalizeVersion.ts';\nimport parseExpression from './parseExpression/index.ts';\n\nimport type { LoadError, LoadOptions, ResolveOptions, Schedule, ScheduleRaw, Version, VersionRaw } from './types.ts';\n\nexport type LoadCallback = (error?: LoadError, semvers?: NodeVersions) => void;\n\nexport default class NodeVersions {\n versions: Version[];\n schedules: Schedule[];\n\n constructor(versions: VersionRaw[], schedule: ScheduleRaw[]) {\n if (!versions) throw new Error('Missing option: versions');\n if (!schedule) throw new Error('Missing option: schedule');\n\n this.schedules = [];\n for (const name in schedule) this.schedules.push(normalizeSchedule(name, schedule[name]));\n this.schedules = this.schedules.sort((a, b) => (semver.gt(semver.coerce(a.semver), semver.coerce(b.semver)) ? 1 : -1));\n\n this.versions = [];\n for (let index = 0; index < versions.length; index++) this.versions.push(normalizeVersion(versions[index], this.schedules));\n this.versions = this.versions.sort((a, b) => (semver.gt(a.semver, b.semver) ? -1 : 1));\n }\n\n static load(callback: LoadCallback): void;\n static load(options: LoadOptions, callback: LoadCallback): void;\n static load(options?: LoadOptions): Promise<NodeVersions>;\n static load(options?: LoadOptions | LoadCallback, callback?: LoadCallback): void | Promise<NodeVersions> {\n if (typeof options === 'function') {\n callback = options;\n options = null;\n }\n options = options || {};\n\n function worker(options, callback) {\n const cache = new Cache((options as LoadOptions).cachePath || CACHE_PATH);\n cache.get<VersionRaw[]>(DISTS_URL, (err, versions): void => {\n if (err) return callback(err);\n\n cache.get(SCHEDULES_URL, (err, schedule: ScheduleRaw[]) => {\n err ? callback(err) : callback(null, new NodeVersions(versions, schedule));\n });\n });\n }\n\n if (typeof callback === 'function') return worker(options, callback);\n return new Promise((resolve, reject) => worker(options, (err, versions) => (err ? reject(err) : resolve(versions))));\n }\n\n static loadSync(options?: LoadOptions): NodeVersions | null {\n options = options || {};\n const cache = new Cache(options.cachePath || CACHE_PATH);\n const versions = cache.getSync<VersionRaw[]>(DISTS_URL);\n const schedule = cache.getSync<ScheduleRaw[]>(SCHEDULES_URL);\n if (!versions || !schedule) return null;\n return new NodeVersions(versions, schedule);\n }\n\n resolve(expression: string | number | Date, options?: ResolveOptions): string | string[] | Version | Version[] | null {\n options = options || {};\n const path = options.path || 'version';\n\n // normalize\n if (typeof expression === 'number') expression = `${expression}`;\n if (typeof expression !== 'string') return null;\n expression = expression.trim();\n\n // single result, try a match\n const query = parseExpression.call(this, expression, options.now || new Date());\n if (query) {\n let version = null;\n for (let index = 0; index < this.versions.length; index++) {\n const test = this.versions[index];\n if (options.now && options.now < test.date) continue;\n if (!match(test, query)) continue;\n version = test;\n break;\n }\n if (version) return version[path];\n }\n\n // filtered expression\n const range = options.range || '';\n const filters = { lts: !!~range.indexOf('lts'), key: undefined, line: undefined };\n filters.key = ~range.indexOf('major') ? major : ~range.indexOf('minor') ? minor : undefined;\n filters.line = ~range.indexOf('even') ? even : ~range.indexOf('odd') ? odd : undefined;\n\n const results = [];\n const founds = {};\n\n for (let index = 0; index < this.versions.length; index++) {\n const test = this.versions[index];\n if (options.now && options.now < test.date) continue;\n if (filters.lts && !test.lts) continue;\n if (filters.line && !filters.line(test)) continue;\n if (!semver.satisfies(test.semver, expression)) continue;\n if (filters.key) {\n if (founds[filters.key(test)]) continue;\n founds[filters.key(test)] = true;\n }\n results.unshift(test[path]);\n }\n return results;\n }\n}\n"],"names":["Cache","semver","CACHE_PATH","DISTS_URL","SCHEDULES_URL","major","minor","even","odd","match","normalizeSchedule","normalizeVersion","parseExpression","NodeVersions","load","options","callback","worker","cache","cachePath","get","err","versions","schedule","Promise","resolve","reject","loadSync","getSync","expression","path","trim","query","call","now","Date","version","index","length","test","date","range","filters","lts","indexOf","key","undefined","line","results","founds","satis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MAAM,EAAED,QAAS,IAAI,CAACf,QAAQ,CAACiC,IAAI,CAAC5C,iBAAiBW,QAAQ,CAACe,MAAM,EAAE,IAAI,CAACgB,SAAS;QACzH,IAAI,CAAC/B,QAAQ,GAAG,IAAI,CAACA,QAAQ,CAACkC,IAAI,CAAC,CAACC,GAAGC,IAAOzD,OAAO0D,EAAE,CAACF,EAAExD,MAAM,EAAEyD,EAAEzD,MAAM,IAAI,CAAC,IAAI;IACrF;AAkFF;AAjGA,SAAqBY,0BAiGpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-semvers/src/assets/postinstall.cts"],"sourcesContent":["const exit = require('exit-compat');\nconst Cache = require('fetch-json-cache');\nconst { CACHE_PATH, DISTS_URL, SCHEDULES_URL } = require('./constants.cts');\n\ntype Callback = (err: Error | null) => void;\n\nfunction fetchWithRetry(cache: typeof Cache.prototype, url: string, retries: number, callback: Callback)
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-semvers/src/assets/postinstall.cts"],"sourcesContent":["const exit = require('exit-compat');\nconst Cache = require('fetch-json-cache');\nconst { CACHE_PATH, DISTS_URL, SCHEDULES_URL } = require('./constants.cts');\n\ntype Callback = (err: Error | null) => void;\n\nfunction fetchWithRetry(cache: typeof Cache.prototype, url: string, retries: number, callback: Callback) {\n cache.get(url, { force: true }, (err: Error | null) => {\n if (err && retries > 0) {\n setTimeout(() => {\n fetchWithRetry(cache, url, retries - 1, callback);\n }, 1000);\n } else {\n callback(err);\n }\n });\n}\n\nfunction cacheWithRetry(callback: Callback) {\n const cache = new Cache(CACHE_PATH);\n fetchWithRetry(cache, DISTS_URL, 3, (err) => {\n if (err) return callback(err);\n fetchWithRetry(cache, SCHEDULES_URL, 3, callback);\n });\n}\n\n// run patch\ncacheWithRetry((err) => {\n if (err) {\n console.log(`postinstall warning: ${err.message}`);\n console.log('Cache not updated after retries.');\n exit(0);\n } else {\n console.log('postinstall succeeded');\n exit(0);\n }\n});\n"],"names":["exit","require","Cache","CACHE_PATH","DISTS_URL","SCHEDULES_URL","fetchWithRetry","cache","url","retries","callback","get","force","err","setTimeout","cacheWithRetry","console","log","message"],"mappings":"AAAA,MAAMA,OAAOC,QAAQ;AACrB,MAAMC,QAAQD,QAAQ;AACtB,MAAM,EAAEE,UAAU,EAAEC,SAAS,EAAEC,aAAa,EAAE,GAAGJ,QAAQ;AAIzD,SAASK,eAAeC,KAA6B,EAAEC,GAAW,EAAEC,OAAe,EAAEC,QAAkB;IACrGH,MAAMI,GAAG,CAACH,KAAK;QAAEI,OAAO;IAAK,GAAG,CAACC;QAC/B,IAAIA,OAAOJ,UAAU,GAAG;YACtBK,WAAW;gBACTR,eAAeC,OAAOC,KAAKC,UAAU,GAAGC;YAC1C,GAAG;QACL,OAAO;YACLA,SAASG;QACX;IACF;AACF;AAEA,SAASE,eAAeL,QAAkB;IACxC,MAAMH,QAAQ,IAAIL,MAAMC;IACxBG,eAAeC,OAAOH,WAAW,GAAG,CAACS;QACnC,IAAIA,KAAK,OAAOH,SAASG;QACzBP,eAAeC,OAAOF,eAAe,GAAGK;IAC1C;AACF;AAEA,YAAY;AACZK,eAAe,CAACF;IACd,IAAIA,KAAK;QACPG,QAAQC,GAAG,CAAC,CAAC,qBAAqB,EAAEJ,IAAIK,OAAO,EAAE;QACjDF,QAAQC,GAAG,CAAC;QACZjB,KAAK;IACP,OAAO;QACLgB,QAAQC,GAAG,CAAC;QACZjB,KAAK;IACP;AACF"}
|
package/dist/esm/cli.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: (argv: string[], name?: string) =>
|
|
1
|
+
declare const _default: (argv: string[], name?: string) => void;
|
|
2
2
|
export default _default;
|
package/dist/esm/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-semvers/src/cli.ts"],"sourcesContent":["import exit from 'exit-compat';\nimport fs from 'fs';\nimport getopts from 'getopts-compat';\nimport path from 'path';\nimport url from 'url';\nimport NodeVersions, { type LoadOptions, type ResolveOptions } from './index.ts';\n// biome-ignore lint/suspicious/noShadowRestrictedNames: Legacy\nimport isNaN from './lib/isNaN.ts';\n\nconst isArray = Array.isArray || ((x) => Object.prototype.toString.call(x) === '[object Array]');\n\nconst ERROR_CODE = 11;\nconst __dirname = path.dirname(typeof __filename !== 'undefined' ? __filename : url.fileURLToPath(import.meta.url));\n\nfunction getVersion(): string {\n const pkgPath = path.join(__dirname, '..', '..', 'package.json');\n return JSON.parse(fs.readFileSync(pkgPath, 'utf8')).version;\n}\n\nfunction printHelp(name: string): void {\n const version = getVersion();\n console.log(`${name} v${version}`);\n console.log('');\n console.log(`Usage: ${name} [options] <version-string>`);\n console.log('');\n console.log('Version Strings:');\n console.log('Any command that calls for a version can be provided any of the');\n console.log('following \"version-ish\" identifies:');\n console.log('');\n console.log('- x.y.z A specific SemVer tuple');\n console.log('- x.y Major and minor version number');\n console.log('- x Just a major version number');\n console.log('- lts The most recent LTS (long-term support) node version');\n console.log('- lts/<name> The latest in a named LTS set. (argon, boron, etc.)');\n console.log('- lts/* Same as just \"lts\"');\n console.log('- latest The most recent (non-LTS) version');\n console.log('- stable Backwards-compatible alias for \"lts\"');\n console.log('- [expression] Engine and semver module expression like \"10.1.x || >=12.0.0\"');\n console.log('');\n console.log('Options:');\n console.log(' -p, --path <path> Path within version including raw for unprocessed version');\n console.log(' -r, --range <range> Range type of major, minor, or patch with filters of lts, even, odd');\n console.log(' -n, --now <date> Use a specific time as a Date.parse');\n console.log(' -v, --version Show version number');\n console.log(' -h, --help Show this help message');\n}\n\nexport default (argv: string[], name?: string):
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-semvers/src/cli.ts"],"sourcesContent":["import exit from 'exit-compat';\nimport fs from 'fs';\nimport getopts from 'getopts-compat';\nimport path from 'path';\nimport url from 'url';\nimport NodeVersions, { type LoadOptions, type ResolveOptions } from './index.ts';\n// biome-ignore lint/suspicious/noShadowRestrictedNames: Legacy\nimport isNaN from './lib/isNaN.ts';\n\nconst isArray = Array.isArray || ((x) => Object.prototype.toString.call(x) === '[object Array]');\n\nconst ERROR_CODE = 11;\nconst __dirname = path.dirname(typeof __filename !== 'undefined' ? __filename : url.fileURLToPath(import.meta.url));\n\nfunction getVersion(): string {\n const pkgPath = path.join(__dirname, '..', '..', 'package.json');\n return JSON.parse(fs.readFileSync(pkgPath, 'utf8')).version;\n}\n\nfunction printHelp(name: string): void {\n const version = getVersion();\n console.log(`${name} v${version}`);\n console.log('');\n console.log(`Usage: ${name} [options] <version-string>`);\n console.log('');\n console.log('Version Strings:');\n console.log('Any command that calls for a version can be provided any of the');\n console.log('following \"version-ish\" identifies:');\n console.log('');\n console.log('- x.y.z A specific SemVer tuple');\n console.log('- x.y Major and minor version number');\n console.log('- x Just a major version number');\n console.log('- lts The most recent LTS (long-term support) node version');\n console.log('- lts/<name> The latest in a named LTS set. (argon, boron, etc.)');\n console.log('- lts/* Same as just \"lts\"');\n console.log('- latest The most recent (non-LTS) version');\n console.log('- stable Backwards-compatible alias for \"lts\"');\n console.log('- [expression] Engine and semver module expression like \"10.1.x || >=12.0.0\"');\n console.log('');\n console.log('Options:');\n console.log(' -p, --path <path> Path within version including raw for unprocessed version');\n console.log(' -r, --range <range> Range type of major, minor, or patch with filters of lts, even, odd');\n console.log(' -n, --now <date> Use a specific time as a Date.parse');\n console.log(' -v, --version Show version number');\n console.log(' -h, --help Show this help message');\n}\n\nexport default (argv: string[], name?: string): void => {\n const cliName = name || 'nsv';\n const options = getopts(argv, {\n alias: { path: 'p', range: 'r', now: 'n', version: 'v', help: 'h' },\n boolean: ['version', 'help'],\n });\n\n if (options.version) {\n console.log(getVersion());\n exit(0);\n return;\n }\n\n if (options.help) {\n printHelp(cliName);\n exit(0);\n return;\n }\n\n if (typeof options.now !== 'undefined') options.now = new Date(isNaN(+options.now) ? Date.parse(options.now) : +options.now);\n\n const args = options._;\n if (args.length < 1) {\n console.log(`Missing version string. Example usage: ${cliName} [version string]. Use ${cliName} --help for information on version strings`);\n exit(ERROR_CODE);\n return;\n }\n\n function stringify(value) {\n return typeof value === 'string' ? value : JSON.stringify(value);\n }\n\n NodeVersions.load(options as LoadOptions, (err, semvers) => {\n if (err) {\n console.log(err.message);\n exit(ERROR_CODE);\n return;\n }\n\n const version = semvers.resolve(args[0], options as ResolveOptions);\n if (!version || (isArray(version) && !(version as string[]).length)) {\n console.log(`Unrecognized: ${args[0]}`);\n exit(ERROR_CODE);\n return;\n }\n\n console.log('versions:');\n if (isArray(version)) {\n for (let index = 0; index < (version as string[]).length; index++) console.log(stringify(version[index]));\n } else console.log(stringify(version));\n exit(0);\n });\n};\n"],"names":["exit","fs","getopts","path","url","NodeVersions","isNaN","isArray","Array","x","Object","prototype","toString","call","ERROR_CODE","__dirname","dirname","__filename","fileURLToPath","getVersion","pkgPath","join","JSON","parse","readFileSync","version","printHelp","name","console","log","argv","cliName","options","alias","range","now","help","boolean","Date","args","_","length","stringify","value","load","err","semvers","message","resolve","index"],"mappings":"AAAA,OAAOA,UAAU,cAAc;AAC/B,OAAOC,QAAQ,KAAK;AACpB,OAAOC,aAAa,iBAAiB;AACrC,OAAOC,UAAU,OAAO;AACxB,OAAOC,SAAS,MAAM;AACtB,OAAOC,kBAA6D,aAAa;AACjF,+DAA+D;AAC/D,OAAOC,WAAW,iBAAiB;AAEnC,MAAMC,UAAUC,MAAMD,OAAO,IAAK,CAAA,CAACE,IAAMC,OAAOC,SAAS,CAACC,QAAQ,CAACC,IAAI,CAACJ,OAAO,gBAAe;AAE9F,MAAMK,aAAa;AACnB,MAAMC,YAAYZ,KAAKa,OAAO,CAAC,OAAOC,eAAe,cAAcA,aAAab,IAAIc,aAAa,CAAC,YAAYd,GAAG;AAEjH,SAASe;IACP,MAAMC,UAAUjB,KAAKkB,IAAI,CAACN,WAAW,MAAM,MAAM;IACjD,OAAOO,KA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,GAAG,GAAG,IAAIG,KAAKhC,MAAM,CAAC0B,QAAQG,GAAG,IAAIG,KAAKf,KAAK,CAACS,QAAQG,GAAG,IAAI,CAACH,QAAQG,GAAG;IAE3H,MAAMI,OAAOP,QAAQQ,CAAC;IACtB,IAAID,KAAKE,MAAM,GAAG,GAAG;QACnBb,QAAQC,GAAG,CAAC,CAAC,uCAAuC,EAAEE,QAAQ,uBAAuB,EAAEA,QAAQ,0CAA0C,CAAC;QAC1I/B,KAAKc;QACL;IACF;IAEA,SAAS4B,UAAUC,KAAK;QACtB,OAAO,OAAOA,UAAU,WAAWA,QAAQrB,KAAKoB,SAAS,CAACC;IAC5D;IAEAtC,aAAauC,IAAI,CAACZ,SAAwB,CAACa,KAAKC;QAC9C,IAAID,KAAK;YACPjB,QAAQC,GAAG,CAACgB,IAAIE,OAAO;YACvB/C,KAAKc;YACL;QACF;QAEA,MAAMW,UAAUqB,QAAQE,OAAO,CAACT,IAAI,CAAC,EAAE,EAAEP;QACzC,IAAI,CAACP,WAAYlB,QAAQkB,YAAY,CAAC,AAACA,QAAqBgB,MAAM,EAAG;YACnEb,QAAQC,GAAG,CAAC,CAAC,cAAc,EAAEU,IAAI,CAAC,EAAE,EAAE;YACtCvC,KAAKc;YACL;QACF;QAEAc,QAAQC,GAAG,CAAC;QACZ,IAAItB,QAAQkB,UAAU;YACpB,IAAK,IAAIwB,QAAQ,GAAGA,QAAQ,AAACxB,QAAqBgB,MAAM,EAAEQ,QAASrB,QAAQC,GAAG,CAACa,UAAUjB,OAAO,CAACwB,MAAM;QACzG,OAAOrB,QAAQC,GAAG,CAACa,UAAUjB;QAC7BzB,KAAK;IACP;AACF,CAAA,EAAE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-semvers",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "Utilities for managing versions of node including looking up codenames",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"node",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
],
|
|
39
39
|
"scripts": {
|
|
40
40
|
"build": "tsds build",
|
|
41
|
-
"build:assets": "tsds
|
|
41
|
+
"build:assets": "tsds validate && mkdir -p assets && cp -R dist/cjs/assets/*.cjs assets/",
|
|
42
42
|
"format": "tsds format",
|
|
43
43
|
"postinstall": "node assets/postinstall.cjs",
|
|
44
44
|
"prepublishOnly": "tsds validate",
|
|
@@ -47,22 +47,22 @@
|
|
|
47
47
|
"version": "tsds version"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"exit-compat": "^1.0.
|
|
51
|
-
"fetch-json-cache": "^1.
|
|
50
|
+
"exit-compat": "^1.0.0",
|
|
51
|
+
"fetch-json-cache": "^1.4.0",
|
|
52
52
|
"getopts-compat": "^2.2.6",
|
|
53
|
-
"semver": "
|
|
53
|
+
"semver": "5.7.2"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@types/mocha": "
|
|
57
|
-
"@types/node": "
|
|
56
|
+
"@types/mocha": "*",
|
|
57
|
+
"@types/node": "*",
|
|
58
58
|
"cr": "^0.1.0",
|
|
59
|
-
"cross-spawn-cb": "^
|
|
60
|
-
"fs-remove-compat": "^0.
|
|
61
|
-
"node-version-use": "
|
|
62
|
-
"pinkie-promise": "
|
|
63
|
-
"rollup": "^4.53.
|
|
64
|
-
"ts-dev-stack": "
|
|
65
|
-
"tsds-config": "^0.
|
|
59
|
+
"cross-spawn-cb": "^3.0.0",
|
|
60
|
+
"fs-remove-compat": "^1.0.0",
|
|
61
|
+
"node-version-use": "*",
|
|
62
|
+
"pinkie-promise": "*",
|
|
63
|
+
"rollup": "^4.53.4",
|
|
64
|
+
"ts-dev-stack": "*",
|
|
65
|
+
"tsds-config": "^1.0.4"
|
|
66
66
|
},
|
|
67
67
|
"engines": {
|
|
68
68
|
"node": ">=0.8"
|