latest-version
Advanced tools
Comparing version 5.0.0 to 5.1.0
@@ -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" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4292
44
Updatedpackage-json@^6.3.0