{"_id":"@yarn-tool/get-global-dirs@1.0.6","bugs":{"url":"https://github.com/bluelovers/ws-yarn-workspaces/issues"},"dist":{"shasum":"f05f1e83a3aa4d9b88f587f2361cc9e2f244414f","tarball":"http://registry-npm.ywwl.com/@yarn-tool/get-global-dirs/download/@yarn-tool/get-global-dirs-1.0.6.tgz","fileCount":6,"integrity":"sha512-DRDzzn5MLD2+zXKrDO0iXpS1pmxmkF93HOJ5ynjPSlC5w3Ch8IFELXkfIcH1YM02PPU1RcMeOrZJFwDl1rMmgw==","signatures":[{"sig":"MEUCIQCW9JAc/NqgAh3WGS28lN0hkANHxR7Rm81/t5pfhD9YiwIgO+aSTWbhCuXUCuXWKG1chsjdgfBmE0Ut/OLzRYzGR3I=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCB/DSeLsnOXmPg79kjtsiMZ2uhEohpRbxw+rCnAm7qKgIhAOHSZOHweMO2qP1sHnWihbou9D0OQpDTJiLn4e7euorY"}],"unpackedSize":36129,"size":8766,"noattachment":false,"key":"/@yarn-tool/get-global-dirs/-/@yarn-tool/get-global-dirs-1.0.6.tgz"},"main":"index.js","name":"@yarn-tool/get-global-dirs","type":"commonjs","types":"./index.d.ts","author":"","gitHead":"008888d233d299e89673cbc45a2712ba9bf825c1","license":"ISC","scripts":{"lint":"pnpm run lint:eslint","pack":"echo pack","test":"tsx ./test/lib/fake-pkg/test.ts","review":"pnpm run review:coverage","prepack":"echo prepack","prepare":"echo prepare","pretest":"echo pretest","publish":"echo publish","tsc:esm":"tsc -p tsconfig.esm.json","version":"echo version","ci:build":"echo ci:build","coverage":"pnpm run test -- --coverage","postpack":"echo postpack","test:tsd":"ynpx tsd","test:jest":"jest --passWithNoTests","test:tsdx":"ynpx @bluelovers/tsdx test --passWithNoTests","build:tsdx":"ynpx @bluelovers/tsdx build --target node --name index","ci:install":"echo ci:install","prepublish":"echo prepublish","preversion":"echo preversion && pnpm run test","test:mocha":"ynpx --quiet -p ts-node -p mocha mocha -- --require ts-node/register \"!(node_modules)/**/*.{test,spec}.{ts,tsx}\"","lint:eslint":"ynpx eslint --ext .ts,.tsx,.mts,.cts ./","postpublish":"echo postpublish","postversion":"echo postversion","review:test":"pnpm run lint && pnpm run test","tsc:default":"tsc -p tsconfig.json","build:dts:tsc":"pnpm run build:dts:tsc:emit && pnpm run build:dts:copy","test:snapshot":"pnpm run test -u","build:dts:copy":"copy .\\src\\index.d.ts .\\dist\\index.d.ts & echo build:dts","prepublishOnly":"echo prepublishOnly","tsc:showConfig":"ynpx get-current-tsconfig -p","postpublishOnly":"echo postpublishOnly","review:coverage":"pnpm run lint && pnpm run coverage","build:dts:bundle":"ynpx @bluelovers/dts-bundle-generator -o ./dist/index.d.ts ./src/index.ts --no-banner --inline-declare-global & echo build:dts:bundle","build:microbundle":"ynpx microbundle --target node","sort-package-json":"yarn-tool sort","build:dts:tsc:emit":"tsc --emitDeclarationOnly --declaration --noEmit false","test:jest:coverage":"pnpm run test:jest -- --coverage","test:jest:snapshot":"pnpm run test:jest -- -u"},"version":"1.0.6","_npmUser":{"name":"bluelovers","email":"codelovers@users.sourceforge.net"},"homepage":"https://github.com/bluelovers/ws-yarn-workspaces/tree/master/packages/@yarn-tool/get-global-dirs#readme","keywords":["global","path","paths","yarn","yarn-tool","pnpm","monorepo","workspaces","npm","lerna","pkg","dependencies","yarnlock","node-modules","packages","package","create-by-yarn-tool"],"repository":{"url":"git+https://github.com/bluelovers/ws-yarn-workspaces.git","type":"git","directory":"packages/@yarn-tool/get-global-dirs"},"_npmVersion":"lerna/7.4.2/node@v26.7.0+x64 (win32)","description":"獲取全局安裝目錄的工具，支援 npm、yarn 和 pnpm。Get global installation directories for npm, yarn, and pnpm.","directories":{},"maintainers":[{"name":"bluelovers","email":"codelovers@users.sourceforge.net"}],"sideEffects":false,"_nodeVersion":"26.7.0","dependencies":{"ini":"^7.0.0","tslib":">=2.8.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"global-dirs":"<4 >=3.0.1","global-directory":"^5.0.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/get-global-dirs_1.0.6_1788737143722_0.7439156824951576"},"readme":"# @yarn-tool/get-global-dirs\n\n> ⚠️ **注意事項**\n\n> 此模組基於 [sindresorhus/global-directory](https://github.com/sindresorhus/global-directory/blob/main/index.js) 並作為 CommonJS (CJS) 模組使用。\n\n> 目前版本存在以下限制與已知問題（源自原版或環境差異）：\n> - **pnpm YAML 支援缺失**：原版模組尚未支援讀取 pnpm 的 YAML 格式配置（如 `config.yaml`），僅支援 `rc` 格式。\n> - **pnpm 套件路徑差異**：在某些環境下，pnpm 的全局套件路徑可能位於 `.../pnpm/store/5/node_modules` 而非預設的 `.../pnpm/global/5/node_modules`。\n> - **暫無修復計畫**：目前暫時不打算針對上述原版即存在的 bug 進行修正。\n\n獲取全局安裝目錄的工具，支援 npm、yarn 和 pnpm。\n\nGet global installation directories for npm, yarn, and pnpm.\n\n## 功能特色\n\n- **多套件管理器支援**: 自動偵測並解析 npm、yarn 和 pnpm 的全局目錄\n- **跨平台相容**: 支援 Windows、macOS 和 Linux\n\n## 安裝\n\n```bash\nyarn add @yarn-tool/get-global-dirs\nyarn-tool add @yarn-tool/get-global-dirs\nyt add @yarn-tool/get-global-dirs\n```\n\n## 使用方法\n\n```typescript\nimport globalDirectory from '@yarn-tool/get-global-dirs';\n\n// 獲取 npm 全局目錄\nconsole.log(globalDirectory.npm.prefix);\n//=> '/usr/local'\n\nconsole.log(globalDirectory.npm.packages);\n//=> '/usr/local/lib/node_modules'\n\nconsole.log(globalDirectory.npm.binaries);\n//=> '/usr/local/bin'\n\n// 獲取 yarn 全局目錄\nconsole.log(globalDirectory.yarn.packages);\n//=> '/Users/username/.config/yarn/global/node_modules'\n\n// 獲取 pnpm 全局目錄\nconsole.log(globalDirectory.pnpm.packages);\n//=> '/Users/username/Library/pnpm/global/5/node_modules'\n```\n\n## API\n\n### globalDirectory\n\n返回一個物件，包含三個屬性：\n\n#### npm: IGlobalDirectoryEntry\n\n- `prefix`: 全局前綴目錄（相當於 `npm prefix --global`）\n- `packages`: 全局套件目錄（相當於 `npm root --global`）\n- `binaries`: 全局二進位檔目錄（相當於 `npm bin --global`）\n\n#### yarn: IGlobalDirectoryEntry\n\n- `prefix`: Yarn 全局資料目錄\n- `packages`: Yarn 全局套件目錄\n- `binaries`: Yarn 全局二進位檔目錄\n\n#### pnpm: IGlobalDirectoryEntry\n\n- `prefix`: pnpm 資料目錄\n- `packages`: pnpm 全局套件目錄\n- `binaries`: pnpm 全局二進位檔目錄\n","publish_time":1788737143805,"_cnpm_publish_time":1788737143805,"dist-tags":{"latest":"1.0.11"}}