npm-cli-version
Get the currently installed npm
CLI version
const npmCliVersion = ; async { await ; //=> '5.5.1'};
Unlike the prior arts, it doesn't execute npm --version
in a child process.
Installation
npm install npm-cli-version
API
const npmCliVersion = ;
npmCliVersion()
Return: Promise<string>
Related projects
- parse-npm-version — Similar to this module, but returns a
Promise
for a node-semver object instead - npm-cli-dir — Resolve the directory path where
npm
CLI is installed. Used by this module.
License
ISC License © 2018 Shinnosuke Watanabe