{"_id":"appdirsjs@1.2.8","bugs":{"url":"https://github.com/codingjerk/appdirsjs/issues"},"dist":{"shasum":"8779e70bc4c5aa205d428c037dfb916e6d7c2d69","tarball":"http://registry-npm.ywwl.com/appdirsjs/download/appdirsjs-1.2.8.tgz","fileCount":4,"integrity":"sha512-8zl1xlxeS4a0/36CT6LOaVioPOL8TeLT1b9OHk0j9xSbzmPBuM7lUgWMSTh6SbuF8fbwjcP1rr30OCLpd1fl+A==","signatures":[{"sig":"MEQCIE824tExuTDq38fj+zKlFA8uBxOCYM4motI0jStzfTyUAiBVCnsXwGs7BQG1tjbqCrPwyzEZyDx0yvI3RnJW1IKadA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDd9UpAGMVYLpaDwFt1/jc5gexLfZiAntAPPe+KsHIVWQIgJgxrt64IiKdhFB5bz4EIY6j1I/Xy450ubae1K3kmSok="}],"unpackedSize":9995,"size":3190,"noattachment":false,"key":"/appdirsjs/-/appdirsjs-1.2.8.tgz"},"main":"dist/index.js","name":"appdirsjs","types":"dist/index.d.ts","funding":[{"url":"https://github.com/sponsors/codingjerk","type":"github"},{"url":"https://www.patreon.com/codingjerk","type":"patreon"}],"gitHead":"1695334ed56c2a9c1b2adbb1e42630a71281ff90","license":"MIT","version":"1.2.8","_npmUser":{"name":"codingjerk","email":"codingjerk@gmail.com"},"homepage":"https://github.com/codingjerk/appdirsjs#readme","repository":{"url":"git+https://github.com/codingjerk/appdirsjs.git","type":"git"},"_npmVersion":"11.16.0","description":"OS-dependent application paths for cache, data and config directories","directories":{},"maintainers":[{"name":"codingjerk","email":"codingjerk@gmail.com"}],"_nodeVersion":"24.18.0","_hasShrinkwrap":false,"devDependencies":{"jest":"^30.4.2","eslint":"^10.8.0","globals":"^17.8.0","ts-jest":"^29.4.12","@eslint/js":"^10.0.1","typescript":"^6.0.3","@types/jest":"^30.0.0","@types/node":"^26.1.2","@typescript-eslint/parser":"^8.65.0","@typescript-eslint/eslint-plugin":"^8.65.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/appdirsjs_1.2.8_1785263554056_0.052213604079471176"},"readme":"# appdirsjs\n\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/codingjerk/appdirsjs/ci.yml)](https://github.com/codingjerk/appdirsjs/actions)\n[![Codecov](https://img.shields.io/codecov/c/gh/codingjerk/appdirsjs)](https://codecov.io/gh/codingjerk/appdirsjs)\n[![npm](https://img.shields.io/npm/v/appdirsjs)](https://www.npmjs.com/package/appdirsjs)\n[![npm bundle size](https://img.shields.io/bundlephobia/min/appdirsjs)](https://www.npmjs.com/package/appdirsjs)\n[![GitHub](https://img.shields.io/badge/license-MIT-blue)](https://github.com/codingjerk/appdirsjs/blob/master/_LICENSE.md)\n\nA lightweight Node.js library providing standardized paths for directories to store configs, caches, and data files according to OS standards. On Linux, it follows the XDG Base Directory Specification. On macOS and Windows, it follows Apple and Microsoft guidelines.\n\n## Installation\n\nUsing npm:\n\n```sh\nnpm install appdirsjs\n```\n\nOr if you use Yarn:\n\n```sh\nyarn add appdirsjs\n```\n\n## Usage\n\n```javascript\nimport appDirs from \"appdirsjs\";\n\nconst dirs = appDirs({ appName: \"expo\" });\n\n// Display the OS-specific cache directory for temporary files\nconsole.log(\"Cache Directory:\", dirs.cache);\n//   Linux:    /home/user/.cache/expo\n//   macOS:    /Users/User/Library/Caches/expo\n//   Windows:  C:\\Users\\User\\AppData\\Local\\Temp\\expo\n\n// Display the OS-specific configuration directory for user settings\nconsole.log(\"Config Directory:\", dirs.config);\n//   Linux:    /home/user/.config/expo\n//   macOS:    /Users/User/Library/Preferences/expo\n//   Windows:  C:\\Users\\User\\AppData\\Roaming\\expo\n\n// Display the OS-specific data directory for application data\nconsole.log(\"Data Directory:\", dirs.data);\n//   Linux:    /home/user/.local/share/expo\n//   macOS:    /Users/User/Library/Application Support/expo\n//   Windows:  C:\\Users\\User\\AppData\\Local\\expo\n```\n\n### Keep backward compatibility\n\nWhen switching from an old-style dotfile directory,\nsuch as `~/.myapp`, to a new one, like `~/.config/myapp`,\nyou can pass the `legacyPath` parameter\nto keep using the old directory if it exists:\n\n```javascript\nimport * as os from \"os\";\nimport * as path from \"path\";\nimport appDirs from \"appdirsjs\";\n\nconst dirs = appDirs({\n  appName: \"expo\",\n  // Use legacy directory if it exists\n  legacyPath: path.join(os.homedir(), \".expo\"),\n});\n\nconsole.log(\"Configuration Directory:\", dirs.config);\n// For instance, on Linux: /home/user/.expo\n```\n\n## TODO\n\n- [ ] Android support\n- [ ] XDG on BSD support\n- [ ] CI tests on `bun` and `deno`\n- [ ] Dev dependencies update\n- [ ] README.md cleanup\n","publish_time":1785263554138,"_cnpm_publish_time":1785263554138,"dist-tags":{"latest":"1.2.8"}}