Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including latest-version with all npm packages installed. Try it out:

var latestVersion = require("latest-version")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

latest-version v5.1.0

Get the latest version of an npm package

latest-version Build Status

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.


$ npm install latest-version


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

(async () => {
    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'



MIT © Sindre Sorhus


RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free