Get the path of npm cache folder
npm install npm-cache-path


Get the path of npm cache folder
``javascript
const npmCachePath = require('npm-cache-path');
(async () => {
await npmCachePath(); //=> '/Users/shinnn/.npm'
})();
`
``
npm install npm-cache-path
`javascript`
const npmCachePath = require('npm-cache-path');
Return: Promise
It tries to get the path of npm cache folder, first from the environment variables, second from the stdout of npm config get cache command.
`javascript
// npm_config_cache=/foo/bar node ./example.js
(async () => {
await npmCachePath(); //=> '/foo/bar'
})();
``
ISC License © 2018 Shinnosuke Watanabe