Package Exports
- npm-cli-path
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (npm-cli-path) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
npm-cli-path
Resolve the path of npm-cli.js
included in the globally installed npm CLI
const npmCliPath = require('npm-cli-path');
npmCliPath().then(result) => {
result; //=> '/usr/local/lib/node_modules/npm/bin/npm-cli.js'
});
Installation
npm install npm-cli-path
API
const npmCliPath = require('npm-cli-path');
npmCliPath()
Return: Promise
instance
It finds the first instance of the given executable in the PATH environment variable, expands all symbolic links and resolves the canonicalized absolute pathname.
'use strict';
const path = require('path');
const npmCliPath = require('npm-cli-path');
npmCliPath('foo', {
path: 'binaries',
cache: {
[path.resolve('binaries/foo')]: '/usr/local/lib/node_modules/foo/bin/foo'
}
}).then((err, resolvedPath) => {
resolvedPath; //=> '/usr/local/lib/node_modules/foo/bin/foo'
}, console.error);
License
Copyright (c) 2015 Shinnosuke Watanabe
Licensed under the MIT License.