Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use standard environment variable for cache dir #36

Open
kohtala opened this issue Sep 8, 2022 · 0 comments
Open

Use standard environment variable for cache dir #36

kohtala opened this issue Sep 8, 2022 · 0 comments

Comments

@kohtala
Copy link

kohtala commented Sep 8, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant