Returns an array of NPM directory paths based on the user's platform and environment.
Please consider following this project's author, Jon Schlinkert, and consider starring the project to show your ❤️ and support.
Install with npm:
$ npm install --save npm-paths
This lib does not include the
require.main.paths in the result array. If you do need the
require.main.paths, use global-paths instead.
const paths = ;console;// specify the CWD to start fromconsole;
Results in something like the following:
// example was run from the "/Users/jonschlinkert/dev/npm-paths/" directory'/Users/jonschlinkert/dev/npm-paths/node_modules''/Users/jonschlinkert/dev/node_modules''/Users/jonschlinkert/node_modules''/Users/node_modules''/node_modules''/usr/local/lib/node_modules''/usr/lib/node_modules'
// example was run from the "F:\\dev\\npm-paths" directory'C:\\Users\\SERVER\\AppData\\Roaming\\node_modules\\npm''C:\\Program Files\\nodejs\\node_modules''F:\\dev\\npm-paths\\node_modules''F:\\dev\\node_modules''F:\\node_modules'
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
$ npm install && npm test
To generate the readme, run the following command:
$ npm install -g verbose/verb#dev verb-generate-readme && verb
You might also be interested in these projects:
- global-modules: The directory used by npm for globally installed npm modules. | homepage
- global-prefix: Get the npm global path prefix. | homepage
This file was generated by verb-generate-readme, v0.8.0, on December 15, 2018.