LinusU / LinusU/node-cachedir

Prefer `process.env.XDG_CACHE_HOME` on macOS

Open
#18 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
26
Forks
6
PR merge metrics
No merged PRs in 30d

Description

If a user explicitly defines an `XDG_CACHE_HOME`, it should be used. This is already the case on posix systems:

```js
function posix (id) {
const cacheHome = process.env.XDG_CACHE_HOME || path.join(os.homedir(), '.cache')
return path.join(cacheHome, id)
}
```

It would make sense to do the same on darwin/macOS:

```js
function darwin (id) {
const cacheHome = process.env.XDG_CACHE_HOME || path.join(os.homedir(), 'Library', 'Caches')
return path.join(cacheHome, id)
}
```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the darwin(id) cache-directory implementation described in the issue and compare it with the posix(id) behavior. Verify that an explicitly set XDG_CACHE_HOME is preferred on macOS while the existing Library/Caches fallback remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, macos, node.js
Domain
operating-systems
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.