diff --git a/.github/workflows/lint-earliest.yml b/.github/workflows/lint-oldest.yml similarity index 63% rename from .github/workflows/lint-earliest.yml rename to .github/workflows/lint-oldest.yml index 9899615d..1f260cd6 100644 --- a/.github/workflows/lint-earliest.yml +++ b/.github/workflows/lint-oldest.yml @@ -1,10 +1,10 @@ -name: "Test Suite: Linter (earliest)" +name: "Test Suite: Linter (oldest)" on: push: pull_request: paths: - - 'earliest/**' + - 'oldest/**' branches: - main workflow_dispatch: @@ -21,7 +21,7 @@ jobs: uses: actions/setup-node@v4 with: node-version: current - - name: Run npm install -w earliest - run: npm install -w earliest - - name: Run npm run lint -w earliest - run: npm run lint -w earliest + - name: Run npm install -w oldest + run: npm install -w oldest + - name: Run npm run lint -w oldest + run: npm run lint -w oldest diff --git a/.github/workflows/tests-earliest.yml b/.github/workflows/tests-oldest.yml similarity index 73% rename from .github/workflows/tests-earliest.yml rename to .github/workflows/tests-oldest.yml index 03a49fb2..b85fdcb3 100644 --- a/.github/workflows/tests-earliest.yml +++ b/.github/workflows/tests-oldest.yml @@ -1,9 +1,9 @@ -name: "Test Suite: @nodevu/core" +name: "Test Suite: @nodevu/oldest" on: pull_request: paths: - - 'earliest/**' + - 'oldest/**' branches: - main workflow_dispatch: @@ -25,7 +25,7 @@ jobs: node-version: ${{ matrix.node-version }} - name: Install most recent npm run: npm install -g npm - - name: Run npm install -w earliest - run: npm install -w earliest - - name: Run npm test -w earliest - run: npm test -w earliest + - name: Run npm install -w oldest + run: npm install -w oldest + - name: Run npm test -w oldest + run: npm test -w oldest diff --git a/README.md b/README.md index 8e605ffa..822df193 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,8 @@ nodevu is composed of a set of modules: * [core](./core/): this is the core, online-only module. It calls out to sources that have version information about Node.js and does the heavy lifting of coercion, merging, and reasoning about that data into a format that is easily accessible and (hopefully!) extremely useful. It transparently provides data from the sources it fetches from, but also adds additional useufl context that it figures out based on time, context, and other signals. * [static](./static/): this is the offline-only version of nodevu. It's simply an interface to both the full context of [core](./core/), in addition to a few subsets of the data core provides. It is automatically updated when there's new information available, though there aren't gaurantees on when that will be available. This is mostly useful if you're not particularly picky about when your version information is availble. - Additional Utilities - * [earliest](./earliest/): this is a utility for finding the earliest LTS or Security release in a Node.js release line. + * [oldest](./oldest/): this is a utility for finding the oldest LTS or Security release in a Node.js release line. + * [newest](./newest/): this is a utility for finding the newest LTS or Security release in a Node.js release line. * [ranges](./ranges/): a module that provides information about ranges of Node.js versions. * [aliases](./aliases/): a module that provides information about aliases for Node.js versions. - Helper Modules diff --git a/earliest/README.md b/earliest/README.md deleted file mode 100644 index 014612e7..00000000 --- a/earliest/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# earliest - -A module that returns earliest LTS or Security release of a given Node.js release line. - -## Usage - -```js -const { earliest } = require('@nodevu/earliest') - -const earliestLts = earliest('v16', 'lts') -const earliestSecurity = earliest('v16', 'security') -``` - -```js -const { lts, security } = require('@nodevu/earliest') - -const earliestLts = earliest('v16', 'lts') -const earliestSecurity = earliest('v16', 'security') -``` - -## API - -This module exports three functions: - -- `earliest(name, type)` - - `name` (string): Node.js release line name. Examples: `v16`, `v11`, `v8`, `v0.10`. - - `type` (string): `lts` or `security`. -- `lts(name)` - - `name` (string): Node.js release line name. Examples: `v16`, `v11`, `v8`, `v0.10`. -- `security(name)` - - `name` (string): Node.js release line name. Examples: `v16`, `v11`, `v8`, `v0.10`. \ No newline at end of file diff --git a/earliest/LICENSE b/oldest/LICENSE similarity index 100% rename from earliest/LICENSE rename to oldest/LICENSE diff --git a/oldest/README.md b/oldest/README.md new file mode 100644 index 00000000..a0a7b708 --- /dev/null +++ b/oldest/README.md @@ -0,0 +1,31 @@ +# @nodevu/oldest + +A module that returns oldest LTS or Security release of a given Node.js release line. + +## Usage + +```js +const { oldest } = require('@nodevu/oldest') + +const oldestLts = oldest('v16', 'lts') +const oldestSecurity = oldest('v16', 'security') +``` + +```js +const { lts, security } = require('@nodevu/oldest') + +const oldestLts = oldest('v16', 'lts') +const oldestSecurity = oldest('v16', 'security') +``` + +## API + +This module exports three functions: + +- `oldest(name, type)` + - `name` (string): Node.js release line name. Examples: `v16`, `v11`, `v8`, `v0.10`. + - `type` (string): `lts` or `security`. +- `lts(name)` + - `name` (string): Node.js release line name. Examples: `v16`, `v11`, `v8`, `v0.10`. +- `security(name)` + - `name` (string): Node.js release line name. Examples: `v16`, `v11`, `v8`, `v0.10`. \ No newline at end of file diff --git a/earliest/biome.json b/oldest/biome.json similarity index 100% rename from earliest/biome.json rename to oldest/biome.json diff --git a/earliest/index.js b/oldest/index.js similarity index 68% rename from earliest/index.js rename to oldest/index.js index d16b3f06..d3226eb2 100644 --- a/earliest/index.js +++ b/oldest/index.js @@ -1,6 +1,6 @@ const nodevu = require('@nodevu/core'); -async function earliest(name, type) { +async function oldest(name, type) { const data = await nodevu(); if (type === 'lts') { @@ -13,13 +13,13 @@ async function earliest(name, type) { } async function lts(name) { - return await earliest(name, 'lts'); + return await oldest(name, 'lts'); } async function security(name) { - return await earliest(name, 'security'); + return await oldest(name, 'security'); } -module.exports.earliest = earliest; +module.exports.oldest = oldest; module.exports.lts = lts; module.exports.security = security; diff --git a/earliest/package.json b/oldest/package.json similarity index 85% rename from earliest/package.json rename to oldest/package.json index be0a4cc2..2a78414e 100644 --- a/earliest/package.json +++ b/oldest/package.json @@ -1,7 +1,7 @@ { - "name": "@nodevu/earliest", + "name": "@nodevu/oldest", "version": "0.1.0", - "description": "a module that returns the earliest lts or security release of the release line passed.", + "description": "a module that returns the oldest lts or security release of the release line passed.", "main": "index.js", "files": ["index.js", "LICENSE"], "scripts": { diff --git a/earliest/test/test.js b/oldest/test/test.js similarity index 78% rename from earliest/test/test.js rename to oldest/test/test.js index ea664297..95772316 100644 --- a/earliest/test/test.js +++ b/oldest/test/test.js @@ -1,16 +1,16 @@ const assert = require('node:assert'); -const { earliest, lts, security } = require('../index'); +const { oldest, lts, security } = require('../index'); const { describe, it } = require('node:test'); describe('check v10', async () => { - describe('running earliest', async () => { + describe('running oldest', async () => { it('should return the correct security version for v10', async () => { - const data = await earliest('v10', 'security'); + const data = await oldest('v10', 'security'); assert.equal(data, '10.14.0'); }); it('should return the correct lts version for v10', async () => { - const data = await earliest('v10', 'lts'); + const data = await oldest('v10', 'lts'); assert.equal(data, '10.13.0'); }); }); diff --git a/package.json b/package.json index 7510ac32..46155eac 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "core", "static", "parsefiles", - "earliest", + "oldest", "newest", "ranges", "aliases",