1.0.0 • Published 4 years ago

has-version v1.0.0

Weekly downloads
6
License
MIT
Repository
github
Last release
4 years ago

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>;

MIT