1.0.0 • Published 8 months ago

resolve-version v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

resolve-version

Resolve version of an installed module.

Install

$ npm i resolve-version

Usage

const resolveVersion = require('resolve-version');

resolveVersion('yarn'); // <= '1.22.19'

API

resolveVersion (module)

Resolves and returns the version of a module, first checking locally, then globally. Returns undefined if fails.

resolveVersion.local (module, options?)

Resolves and returns the local version of a module.

resolveVersion.global (module, options?)

Resolves and returns the global version of a module.

module

Type: string Module you want to get version of.

options

Type: object

silent

Type: boolean Default: false

Returns undefined instead of throwing error if the module was not found.

License

MIT