1.0.0 • Published 7 years ago
npm-cli-version v1.0.0
npm-cli-version
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
npm install npm-cli-versionAPI
const npmCliVersion = require('npm-cli-version');npmCliVersion()
Return: Promise<string>
Related projects
- parse-npm-version — Similar to this module, but returns a
Promisefor a node-semver object instead - npm-cli-dir — Resolve the directory path where
npmCLI is installed. Used by this module.
License
ISC License © 2018 Shinnosuke Watanabe