npm-cache-path

2.0.0 • Public • Published

npm-cache-path

npm version Build Status Coverage Status

Get the path of npm cache folder

const npmCachePath = require('npm-cache-path');
 
(async () => {
  await npmCachePath(); //=> '/Users/shinnn/.npm'
})();

Installation

Use npm.

npm install npm-cache-path

API

const npmCachePath = require('npm-cache-path');

npmCachePath()

Return: Promise<string>

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.

// npm_config_cache=/foo/bar node ./example.js
 
(async () => {
  await npmCachePath(); //=> '/foo/bar'
})();

License

ISC License © 2018 Shinnosuke Watanabe

Package Sidebar

Install

npm i npm-cache-path

Weekly Downloads

218

Version

2.0.0

License

ISC

Unpacked Size

3.43 kB

Total Files

4

Last publish

Collaborators

  • shinnn