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 - npm Package Compare versions

Comparing version 2.0.0 to 3.0.0

8

index.js
'use strict';
var packageJson = require('package-json');
const packageJson = require('package-json');
module.exports = function (name) {
return packageJson(name.toLowerCase(), 'latest').then(function (data) {
return data.version;
});
};
module.exports = name => packageJson(name.toLowerCase(), 'latest').then(data => data.version);
{
"name": "latest-version",
"version": "2.0.0",
"description": "Get the latest version of a npm package",
"version": "3.0.0",
"description": "Get the latest version of an npm package",
"license": "MIT",

@@ -13,3 +13,3 @@ "repository": "sindresorhus/latest-version",

"engines": {
"node": ">=0.10.0"
"node": ">=4"
},

@@ -33,13 +33,9 @@ "scripts": {

"dependencies": {
"package-json": "^2.0.0"
"package-json": "^3.0.0"
},
"devDependencies": {
"ava": "*",
"semver-regex": "^1.0.0",
"xo": "*"
},
"xo": {
"ignores": [
"test.js"
]
}
}
# latest-version [![Build Status](https://travis-ci.org/sindresorhus/latest-version.svg?branch=master)](https://travis-ci.org/sindresorhus/latest-version)
> Get the latest version of a npm package
> Get the latest version of an npm package

@@ -22,3 +22,3 @@ Fetches the version directly from the registry instead of depending on the massive [npm](https://github.com/npm/npm/blob/8b5e7b6ae5b4cd2d7d62eaf93b1428638b387072/package.json#L37-L85) module like the [latest](https://github.com/bahamas10/node-latest) module does.

console.log(version);
//=> '0.2.0'
//=> '0.18.0'
});

@@ -41,2 +41,2 @@

MIT © [Sindre Sorhus](http://sindresorhus.com)
MIT © [Sindre Sorhus](https://sindresorhus.com)
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