Socket
Socket
Sign inDemoInstall

latest-version

Package Overview
Dependencies
33
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.0.0 to 5.1.0

52

index.d.ts

@@ -1,14 +0,42 @@

export interface Options {
/**
* A semver range or [dist-tag](https://docs.npmjs.com/cli/dist-tag).
*/
readonly version?: string;
declare namespace latestVersion {
interface Options {
/**
A semver range or [dist-tag](https://docs.npmjs.com/cli/dist-tag).
*/
readonly version?: string;
}
}
/**
* Get the latest version of an npm package.
*/
export default function latestVersion(
packageName: string,
options?: Options
): Promise<string>;
declare const latestVersion: {
/**
Get the latest version of an npm package.
@example
```
import 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'
})();
```
*/
(packageName: string, options?: latestVersion.Options): Promise<string>;
// TODO: Remove this for the next major release, refactor the whole definition to:
// declare function latestVersion(
// packageName: string,
// options?: latestVersion.Options
// ): Promise<string>;
// export = latestVersion;
default: typeof latestVersion;
};
export = latestVersion;

@@ -10,2 +10,3 @@ 'use strict';

module.exports = lastestVersion;
// TODO: Remove this for the next major release
module.exports.default = lastestVersion;
{
"name": "latest-version",
"version": "5.0.0",
"version": "5.1.0",
"description": "Get the latest version of an npm package",

@@ -16,3 +16,3 @@ "license": "MIT",

"scripts": {
"test": "xo && ava && tsd-check"
"test": "xo && ava && tsd"
},

@@ -34,11 +34,11 @@ "files": [

"dependencies": {
"package-json": "^6.1.0"
"package-json": "^6.3.0"
},
"devDependencies": {
"ava": "^1.3.1",
"semver": "^5.6.0",
"ava": "^1.4.1",
"semver": "^6.0.0",
"semver-regex": "^2.0.0",
"tsd-check": "^0.3.0",
"tsd": "^0.7.2",
"xo": "^0.24.0"
}
}
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc