Skip to content

Commit

Permalink
update node-version with download hyperlink
Browse files Browse the repository at this point in the history
  • Loading branch information
Biswasindhu Mandal authored and Biswasindhu Mandal committed Dec 13, 2024
1 parent 933fd6a commit 4934a2d
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions node-version.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
<!-- <script src="index.js"></script> -->
<script>
let getAllData = {};
const getReleaseURL = (version) => version ? `https://nodejs.org/download/release/v${version}/` : '';
const getTitle = (version) => getAllData.filter(ele => ele.version === `v${version}`)[0].lts;
function shoeCombinedData(arr1, arr2) {
if (arr1.length < arr2.length) {
let _temp = arr1; arr1 = arr2; arr2 = _temp;
Expand All @@ -51,8 +53,16 @@
</tr>`
for (let i = 0; i < arr2.length; i++) {
st += `<tr>
<th>${arr1[i]}</th>
<th>${arr2[i] ? arr2[i] : ''}</th>
<th>
<a href="${getReleaseURL(arr1[i])}" target="blank" title="Old Version">
${arr1[i]}
</a>
</th>
<th> ${getTitle(arr2[i] ? arr2[i] : '')} :
<a href="${getReleaseURL(arr2[i] ? arr2[i] : '')}" target="blank" title="LTS">
${arr2[i] ? arr2[i] : ''}
</a>
</th>
</tr>`;
}
st += `</table>`
Expand All @@ -68,6 +78,7 @@
if (req.readyState === XMLHttpRequest.DONE) {
if (req.status === 200) {
getAllData = JSON.parse(req.response);
debugger;

const currentNodeVersions = getAllData.filter(x => !(x.lts === false)).map(x => x = x.version.replace(/v/gi, ''));
const ltsNodeVersion = getAllData.filter(x => (x.lts === false)).map(x => x = x.version.replace(/v/gi, ''));
Expand Down

0 comments on commit 4934a2d

Please sign in to comment.