You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

latest-version

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

latest-version

Get the latest version of an npm package


Version published
Weekly downloads
6.6M
increased by1.57%
Maintainers
1
Install size
2.61 MB
Created
Weekly downloads
 

Package description

What is latest-version?

The 'latest-version' npm package allows you to fetch the latest version of an npm package from the npm registry. It is useful for checking if a package is up-to-date or for automating updates in your projects.

What are latest-version's main functionalities?

Fetch Latest Version

This feature allows you to fetch the latest version of a specified npm package. In the code sample, it fetches the latest version of the 'npm' package.

const latestVersion = require('latest-version');

(async () => {
  console.log(await latestVersion('npm'));
  //=> '7.24.0'
})();

Fetch Latest Version with Specific Tag

This feature allows you to fetch the latest version of a specified npm package with a specific tag. In the code sample, it fetches the latest beta version of the 'npm' package.

const latestVersion = require('latest-version');

(async () => {
  console.log(await latestVersion('npm', { version: 'beta' }));
  //=> '8.0.0-beta.0'
})();

Other packages similar to latest-version

Readme

Source

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'));
//=> '0.18.0'

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

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

Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Keywords

FAQs

Package last updated on 23 Jun 2022

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc