Resolve the path of npm-cli.js
included in the globally installed npm CLI
const npmCliPath = require('npm-cli-path');
(async () => {
const path = npmCliPath(); //=> '/usr/local/lib/node_modules/npm/bin/npm-cli.js'
})();
npm install npm-cli-path
const npmCliPath = require('npm-cli-path');
Return: Promise<string>
It resolves the path of npm-cli.js
which is the entry point of npm CLI.
ISC License © 2017 - 2019 Watanabe Shinnosuke