has-version
v1.0.0
Published
Check if NPM has the version of a given package
Downloads
155
Maintainers
Readme
Check if NPM has the version of a given package.
Installation
yarn add has-version
npm install has-version
API
Usage
import hasVersion from "has-version";
hasVersion("chalk", "1.0.0").then((result) => {
console.log(result); // true
});
hasVersion("chalk", "999.999.999").then((result) => {
console.log(result); // false
});
hasVersion("a-package-that-doesnt-exist", "1.0.0").then((result) => {
console.log(result); // undefined
});
Types
import hasVersion from "has-version";
function hasVersion(name: string, version: string): Promise<boolean | undefined>;
- cross-fetch-json: Universal fetch API that only returns JSON
- @bconnorwhite/bob: Bob is a toolkit for TypeScript projects