https://github.com/lite-js/module-path
locate the path of an installed node module
https://github.com/lite-js/module-path
Last synced: 11 months ago
JSON representation
locate the path of an installed node module
- Host: GitHub
- URL: https://github.com/lite-js/module-path
- Owner: lite-js
- License: mit
- Created: 2015-10-19T07:07:03.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-07-13T03:01:12.000Z (almost 9 years ago)
- Last Synced: 2025-07-03T10:50:17.014Z (11 months ago)
- Language: JavaScript
- Homepage: http://leungwensen.github.io/node-module-path/
- Size: 17.6 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
module-path
===========
[](https://badge.fury.io/js/%40lite-js%2Fmodule-path) [](https://travis-ci.org/lite-js/module-path)
locate the path of an installed node module
## install
```shell
$ npm install @lite-js/module-path [-g]
```
## API
```javascript
const modulePath = require('@lite-js/module-path')
// global module
console.log(modulePath('zfinder'))
// => /Users/liangwensen/.nvm/versions/node/v4.2.2/lib/node_modules/.zfinder_npminstall/zfinder/0.2.9/zfinder/lib/index.js
// local module
console.log(modulePath('mocha'))
// => /Users/liangwensen/repo/leungwensen/module-path/node_modules/.npminstall/mocha/3.4.2/mocha/index.js
// core module
console.log(modulePath('path'))
// => path
```
## CLI
```shell
$ npm install @lite-js/module-path -g
$ module-path zfinder
# /Users/liangwensen/.nvm/versions/node/v4.2.2/lib/node_modules/.zfinder_npminstall/zfinder/0.2.9/zfinder/lib/index.js
$ module-path npm
# /Users/liangwensen/.nvm/versions/node/v4.2.2/lib/node_modules/npm/lib/npm.js
```
## Thanks to
* [tj/commander.js](https://github.com/tj/commander.js)