fetch-node-release

Fetch latest Node.js release version by keyword such as "stable", "lts/carbon" or "lts/*"

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
fetch-node-release
101.0.14 years ago4 years agoMinified + gzip package size for fetch-node-release in KB

Readme

fetch-node-release
!buildtravis-imagetravis-url
Fetch latest Node.js release version by keyword such as stable, lts/carbon or lts/*.
JavaScript Style Guide

Usage

const fetch = require('fetch-node-release');

(async () => {
  let version;
  // fetch latest stable version
  version = await fetch('stable');
  console.log('latest stable', version);

  // fetch latest lts/boron version
  version = await fetch('lts/boron');
  console.log('latest lts/boron', version);

  // fetch latest lts version
  version = await fetch('lts/*');
  console.log('latest lts', version);
})().catch((err) => {
  console.error(err);
  process.exitCode = 1;
});

Caveats

  • fetches data from https://nodejs.org/dist/ so it will reject if there's no internet access or
upon HTTP failures
  • will reject if you provide invalid lts branch name
  • will explode the moment node lts releases run out of alphabet ;)