1. latest-version
Get the latest version of an npm package
latest-version
Package: latest-version
Created by: sindresorhus
Last modified: Tue, 27 Feb 2024 06:33:04 GMT
Version: 9.0.0
License: MIT
Downloads: 25,314,027
Repository: https://github.com/sindresorhus/latest-version

Install

npm install latest-version
yarn add latest-version

latest-version

Get the latest version of an npm package

Fetches the version directly from the registry instead of depending on the massive npm module like the latest module does.

Install

 npm install latest-version

Usage

 import latestVersion from 'latest-version';

console.log(await latestVersion('ava'));
//=> '6.1.1'

console.log(await latestVersion('@sindresorhus/df'));
//=> '4.0.0'

// Also works with semver ranges and dist-tags
console.log(await latestVersion('npm', {version: 'latest-5'}));
//=> '5.10.0'

This package exposes the version, registryUrl, and omitDeprecated options from package-json, as well as the PackageNotFoundError and VersionNotFoundError errors.

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code