npm-cli-version

Get the currently installed `npm` CLI version

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
npm-cli-version
1.0.05 years ago7 years agoMinified + gzip package size for npm-cli-version in KB

Readme

npm-cli-version
npm version Build Status Build status Coverage Status
Get the currently installed npm CLI version
const npmCliVersion = require('npm-cli-version');

(async () => {
  await npmCliVersion(); //=> '5.5.1'
})();

Unlike the prior arts, it doesn't execute npm --version in a child process.

Installation

Use npm.
npm install npm-cli-version

API

const npmCliVersion = require('npm-cli-version');

npmCliVersion()

Return: Promise<string>

Related projects

License

ISC License © 2018 Shinnosuke Watanabe