JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 287
  • Score
    100M100P100Q72607F
  • License ISC

Get the path of npm cache folder

Package Exports

  • npm-cache-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-cache-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-cache-path

npm version Build Status 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([options])

options: Object (child_process.execFile options except for encoding option and shell option)
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