GitShow/sindresorhus/find-cache-directory
sindresorhus

find-cache-directory

Finds the common standard cache directory

by sindresorhus
cachenodejsnpm
Star on GitHubForknpm

JavaScript

163 stars25 forks14 contributorsQuiet · 1y agoSince 2015v6.0.0MIT

Meet the team

See all 14 on GitHub →
sindresorhus
sindresorhus26 contributions
jamestalmage
jamestalmage9 contributions
Richienb
Richienb4 contributions
coreyfarrell
coreyfarrell3 contributions
smondal
smondal3 contributions
BrainBacon
BrainBacon1 contribution
hzoo
hzoo1 contribution
thangngoc89
thangngoc891 contribution

Languages

View on GitHub →
JavaScript89.5%
TypeScript10.5%

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

4 of 6 standards met

Community profile →
85
✓README✓License✓Contributing✓Code of Conduct○Issue Template○PR Template

Recent fixes

View closed PRs →
cdauth
Allow read-only `node_modules` folder with more sophisticated type checkClosedIssue

I'm hardening the Docker image of my Node.js app by making the whole app owned by root but run it as another user so that it cannot modify itself. To make the cache work, only the folder is owned by the app user. Currently, with the changes introduced by #10, returns if is not writable. Here is how I think the permission check should work instead if is found: If exists: If it is writeable, return , otherwise return Otherwise, if exists: If it is writeable, return , otherwise return Otherwise: If is writeable, return , otherwise return As a workaround for now, I can specify the cache dir using the environment variable.

cdauth · 9mo ago
kohtala
Use standard environment variable for cache dirClosedIssue

Hi. I'm using some packages using find-cache-dir and needed to have the cache out from node_modules. I did not find this mentioned, so I'd like to have it clarified. Many systems already have a standard cache directory. It is specified at https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html. Namely one specified by $XDG_CACHE_HOME with default at $HOME/.cache For Windows the folder should be under %LOCALAPPDATA%. Known folders on Windows are specified at https://docs.microsoft.com/en-us/windows/win32/shell/knownfolderid. The "Finds the common standard cache directory" at top of readme.md does not really specify the scope of the cache directory. Common across packages in one project, projects of the user, or shared between users? If it is intended to be per project, the above locations can not be used without using some kind of project specific subfolder. If it is intended to work only for one project, I would like to see CACHE_DIR defined to point out that it should have different value for each project.

kohtala · 9mo ago
nvlang
Incorrect deprecation notice on NPMClosedIssue

If one goes to https://www.npmjs.com/package/find-cache-dir, one sees a notice at the top saying This package has been deprecated Author message: Renamed to . However, the repository and source files therein refer to , so I suspect that the deprecation notice might be incorrect?

nvlang · 1y ago
Structured data for AI agents

Repository: sindresorhus/find-cache-directory. Description: Finds the common standard cache directory Stars: 163, Forks: 25. Primary language: JavaScript. Languages: JavaScript (89.5%), TypeScript (10.5%). License: MIT. Topics: cache, nodejs, npm. Latest release: v6.0.0 (1y ago). Open PRs: 0, open issues: 0. Last activity: 1y ago. Community health: 85%. Top contributors: sindresorhus, jamestalmage, Richienb, coreyfarrell, smondal, BrainBacon, hzoo, thangngoc89, LinusU, ndelangen and others.

·@ofershap

Replace github.com with gitshow.dev