New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

get-node-versions

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-node-versions

Find node versions with a powerful syntax

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

get-node-versions

get-node-versions is a simple package to get an array of specific node versions.

Installation

As a library

npm install --save get-node-versions

As a cli tool

npm install -g get-node-versions

Usage

As a library

import {GetNodeVersions} from "get-node-versions"

GetNodeVersions.parse(["major", "minor | eq:6", "0.12"]).then((versions) => {
    console.log(versions);
});

As a cli program

$ get-node-versions "major | eq:6" "minor | lt:5 | gte:4.0.0"
4.1.2
4.2.6
4.3.2
4.4.7
4.5.0
4.6.0
6.7.0

API

GetNodeVersions

  • parse(versions: string | Array<string>): Promise<Array<string>>
    • Parse input and return valid nodejs versions
  • NODEJS_MIRROR: string
    • Mirror to use to retrieve the nodejs version list. default: https://nodejs.org/dist/
  • versionListCache: Array<VersionListCacheItem>
    • Set this to skip pulling versions from the mirror.

VersionListCacheItem

  • version: string
  • date: string
  • files: Array<string>
  • npm: string
  • v8: string
  • uv: string
  • zlib: string
  • openssl: string
  • modules: string
  • lts: boolean

Versions Syntax

get-node-versions sports a very flexible version syntax. The version syntax follows the following format:

(version or keyword) | filter | filter | ...

You must specify one version or one keyword and then any number of filters (or zero). Whitespace is optional.

Possible Versions

VersionExampleDescription
X6Resolves to the greatest single version of X.
X.Y6.1Resolves to the greatest single version of X.Y.
X.Y.Z6.1.2Resolves to exactly X.Y.Z.

Possible Keywords

KeywordDescription
majorResolves to a list of all the latest major versions. Does not include legacy versions.
minorResolves to a list of all the latest minor versions. Does not include legacy versions.
patchResolves to a list of all patch versions. Does not include legacy versions.
legacyResolves to a list of all the legacy versions, which is everything that starts with major version 0.
allResolves to every single version available.

Possible Filters

FilterDescription
gt:versionFilter to only versions greater than version.
gte:versionFilter to only versions greater than or equal to version.
lt:versionFilter to only versions less than version.
lte:versionFilter to only versions less than or equal to version.
eq:versionFilter to only versions matching version.
neq:versionFilter to only versions not matching version.
ltsFilter to only LTS versions.

version can be a partial version.

Examples

Minor versions of v6, and major versions of everything else.

get-node-versions -"minor | eq:6" "major | lt:6"

All major versions, plus a subset of version 4.

get-node-versions "major" "patch | gte:4.2 | lte:4.6"

Every single LTS version and the popular legacy versions.

get-node-versions "patch | lts" 0.12 0.10

You do not need to worry if multiple versions overlap, as they are de-duplicated.

Keywords

FAQs

Package last updated on 07 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc