A lightweight zero-dependency JavaScript library (v1.2.7) for resolving OS-standard application directories for cache, config, and data files. Works on Linux (XDG), macOS (Apple conventions), and Windows (FOLDERID). Ships TypeScript types and supports legacy fallback via `legacyPath`. Unlike similar Python-inspired libraries, it is minimal, synchronous, and specifically designed for cross-platform Node.js apps. Released under MIT license with no notable release cadence (last stable version).
npm install appdirsjsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to get OS-standard cache, config, and data directories for an application named 'myapp'.
Use dynamic import: `const appDirs = await import('appdirsjs')` or configure your project for ESM.Always provide an `appName` string.
Use `path.join(os.homedir(), '.myapp')` to construct an absolute path.
Run `npm install appdirsjs` and ensure `import` is from 'appdirsjs' (not a subpath).
Switch to `import appDirs from 'appdirsjs'` or use dynamic import.
Use `const dirs = appDirs(...)` not `const { cache } = appDirs(...)`.No dependency data recorded yet.