{"name":"@yarn-tool/get-paths-by-type","version":"2.0.19","description":"根據類型 Symbol 取得對應的路徑陣列（支援全域 npm/yarn 路徑） / Get corresponding path array based on type Symbol (supports global npm/yarn paths)","keywords":["yarn-tool","get-paths","global-dirs","global-paths","symbol","path-resolver","npm-global","yarn-global","yarn","npm","workspaces","monorepo","node-modules","packages","package"],"homepage":"https://github.com/bluelovers/ws-yarn-workspaces/tree/master/packages/@yarn-tool/get-paths-by-type#readme","bugs":{"url":"https://github.com/bluelovers/ws-yarn-workspaces/issues"},"repository":{"type":"git","url":"git+https://github.com/bluelovers/ws-yarn-workspaces.git","directory":"packages/@yarn-tool/get-paths-by-type"},"license":"ISC","author":{"name":"bluelovers"},"main":"index.js","scripts":{"coverage":"pnpm run test -- --coverage","lint":"ynpx --quiet eslint -- **/*.ts","test":"jest --passWithNoTests","test:jest":"jest --passWithNoTests","test:jest:coverage":"pnpm run test:jest -- --coverage","test:jest:snapshot":"pnpm run test:jest -- -u","test:mocha":"ynpx --quiet -p ts-node -p mocha mocha -- --require ts-node/register \"!(node_modules)/**/*.{test,spec}.{ts,tsx}\"","test:snapshot":"pnpm run test -u","test:tsd":"ynpx tsd","preversion":"echo preversion && pnpm run test","prepublishOnly:update":"pnpm run ncu && pnpm run sort-package-json","ncu":"yarn-tool ncu -u","sort-package-json":"yarn-tool sort","tsc:showConfig":"ynpx get-current-tsconfig -p"},"dependencies":{"@yarn-tool/fnm-detect":"^1.0.8","@yarn-tool/get-global-dirs":"^1.0.6","tslib":">=2.8.1"},"publishConfig":{"access":"public"},"gitHead":"008888d233d299e89673cbc45a2712ba9bf825c1","types":"./index.d.ts","_id":"@yarn-tool/get-paths-by-type@2.0.19","_nodeVersion":"26.7.0","_npmVersion":"lerna/7.4.2/node@v26.7.0+x64 (win32)","dist":{"integrity":"sha512-gkcuUHWE2VnkPsRqiJiJVbYWROmJdSbUiQzpgzm/7Sbyrg/Q5TPwMFlXs+TVbwvgVvTYzxyPTguyZyefq/8+MA==","shasum":"fa8ff72944a5a63201e8207778f0a968e525a18a","tarball":"http://registry-npm.ywwl.com/@yarn-tool/get-paths-by-type/download/@yarn-tool/get-paths-by-type-2.0.19.tgz","fileCount":6,"unpackedSize":31968,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICpMOIwCACE9R8qpIes+VYPvClOTEGuKkxed75OxJPrWAiATplZ6Cb3qVaOdBYKQV82QPuAo7eqFhsUsCKQPc3XKCA=="}],"size":7840,"noattachment":false,"key":"/@yarn-tool/get-paths-by-type/-/@yarn-tool/get-paths-by-type-2.0.19.tgz"},"_npmUser":{"name":"bluelovers","email":"codelovers@users.sourceforge.net"},"directories":{},"maintainers":[{"name":"bluelovers","email":"codelovers@users.sourceforge.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/get-paths-by-type_2.0.19_1788737118915_0.8666623737034045"},"_hasShrinkwrap":false,"readme":"# @yarn-tool/get-paths-by-type\n\n根據類型 Symbol 取得對應的路徑陣列（支援全域 npm/yarn 路徑、當前目錄、主模組路徑）。\nGet corresponding path array based on type Symbol (supports global npm/yarn paths, current directory, and main module path).\n\n## 安裝 (Installation)\n\n```bash\n# 使用 yarn / Using yarn\nyarn add @yarn-tool/get-paths-by-type\n\n# 使用 yarn-tool / Using yarn-tool\nyarn-tool add @yarn-tool/get-paths-by-type\n# yt 是 yarn-tool 的別名 / yt is an alias for yarn-tool\nyt add @yarn-tool/get-paths-by-type\n\n# 使用 pnpm / Using pnpm\npnpm add @yarn-tool/get-paths-by-type\n\n# 使用 npm / Using npm\nnpm install @yarn-tool/get-paths-by-type\n```\n\n## 使用範例 (Usage Example)\n\n```typescript\nimport getPathsByType, {\n  SymbolCurrentDirectory,\n  SymbolGlobal,\n  SymbolGlobalNpm,\n  SymbolGlobalYarn,\n  SymbolModuleMain,\n} from '@yarn-tool/get-paths-by-type';\n\n// 取得全域 Yarn 套件目錄 / Get global Yarn package directory\nconst yarnPaths = getPathsByType(SymbolGlobalYarn);\nconsole.log(yarnPaths); // ['/usr/local/share/.config/yarn/global/node_modules']\n\n// 取得全域 Npm 套件目錄 / Get global Npm package directory\nconst npmPaths = getPathsByType(SymbolGlobalNpm);\nconsole.log(npmPaths); // ['/usr/local/lib/node_modules']\n\n// 取得所有全域路徑（Yarn + Npm）/ Get all global paths (Yarn + Npm)\nconst globalPaths = getPathsByType(SymbolGlobal);\nconsole.log(globalPaths); // [yarn packages path, npm packages path]\n\n// 取得當前工作目錄 / Get current working directory\nconst cwdPaths = getPathsByType(SymbolCurrentDirectory);\nconsole.log(cwdPaths); // [process.cwd()]\n\n// 取得當前目錄（指定路徑）/ Get current directory (specified path)\nconst customCwdPaths = getPathsByType(SymbolCurrentDirectory, '/custom/path');\n\n// 取得主模組路徑 / Get main module path\nconst mainModulePaths = getPathsByType(SymbolModuleMain);\n```\n\n## API\n\n### `getPathsByType(valueType, cwd?)`\n\n根據類型 Symbol 取得對應的路徑陣列。\n\n**參數 (Parameters):**\n- `valueType` - 路徑類型 Symbol / Path type Symbol\n- `cwd` - 工作目錄（選填，用於 SymbolCurrentDirectory）/ Working directory (optional, for SymbolCurrentDirectory)\n\n**返回 (Returns):** `string[]` - 路徑陣列 / Path array\n\n### Symbol 類型 (Symbol Types)\n\n| Symbol | 說明 / Description |\n|--------|-------------------|\n| `SymbolCurrentDirectory` | 當前工作目錄 / Current working directory |\n| `SymbolGlobal` | 全域 Yarn + Npm 套件目錄 / Global Yarn + Npm package directories |\n| `SymbolGlobalNpm` | 全域 Npm 套件目錄 / Global Npm package directory |\n| `SymbolGlobalYarn` | 全域 Yarn 套件目錄 / Global Yarn package directory |\n| `SymbolModuleMain` | 主模組的路徑 / Main module path |\n\n## License\n\nISC","publish_time":1788737119051,"_cnpm_publish_time":1788737119051,"dist-tags":{"latest":"2.0.26"}}