diff --git a/index.d.ts b/index.d.ts index a56649f..d672b6f 100644 --- a/index.d.ts +++ b/index.d.ts @@ -16,6 +16,7 @@ interface VersionInfo { lts?: Date; maintenance?: Date; end?: Date; + releaseDate: Date; } declare function nv(alias?: string|string[], opts?: Options): Promise; diff --git a/index.js b/index.js index edd918d..5385291 100644 --- a/index.js +++ b/index.js @@ -86,7 +86,8 @@ async function getLatestVersionsByCodename (now, cache, mirror) { start: s && s.start && new Date(s.start), lts: s && s.lts && new Date(s.lts), maintenance: s && s.maintenance && new Date(s.maintenance), - end: s && s.end && new Date(s.end) + end: s && s.end && new Date(s.end), + releaseDate: new Date(ver.date) } // All versions get added to all diff --git a/test/index.js b/test/index.js index 34e036d..ec7034a 100644 --- a/test/index.js +++ b/test/index.js @@ -16,6 +16,7 @@ suite('nv', () => { assert.strictEqual(typeof versions[0].patch, 'number') assert.strictEqual(versions[0].codename, 'dubnium') assert.strictEqual(versions[0].versionName, 'v10') + assert.strictEqual(versions[0].releaseDate.toISOString(), '2021-04-06T00:00:00.000Z') assert.strictEqual(versions[0].start.toISOString(), '2018-04-24T00:00:00.000Z') assert.strictEqual(versions[0].lts.toISOString(), '2018-10-30T00:00:00.000Z') assert.strictEqual(versions[0].maintenance.toISOString(), '2020-05-19T00:00:00.000Z')