Skip to content

Get the currently installed npm version

License

Notifications You must be signed in to change notification settings

shinnn/npm-cli-version

Repository files navigation

npm-cli-version

npm version 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 - 2019 Shinnosuke Watanabe