{"name":"@yarn-tool/get-paths-by-type","version":"2.0.17","keywords":["yarn-tool","get-paths","global-dirs","global-paths","symbol","path-resolver","npm-global","yarn-global","yarn","npm","workspaces","monorepo","node-modules","packages","package"],"author":{"name":"bluelovers"},"license":"ISC","_id":"@yarn-tool/get-paths-by-type@2.0.17","maintainers":[{"name":"bluelovers","email":"codelovers@users.sourceforge.net"}],"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"},"dist":{"shasum":"c4d243fc554436d274354ba20ba32ad304c79228","tarball":"http://registry-npm.ywwl.com/@yarn-tool/get-paths-by-type/download/@yarn-tool/get-paths-by-type-2.0.17.tgz","fileCount":6,"integrity":"sha512-bPhAI2vAIdKajHXJKSDwrNJd1CKtQy3jEt+qDvL6+9gHQOIdjGQmLBa6IOt2PoNHAs09FCTISPBNjjS8Rh51rQ==","signatures":[{"sig":"MEYCIQCoYs23Ql3exYeJOUjaE8ZD+ot3nexa32Tyv7fl9NqYBgIhAIKNO5fP/aZjun10VipHbu80fYshmRzNlrE93cVW/u2C","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":30975,"size":7579,"noattachment":false,"key":"/@yarn-tool/get-paths-by-type/-/@yarn-tool/get-paths-by-type-2.0.17.tgz"},"main":"index.js","types":"./index.d.ts","gitHead":"2cbfd8a3dfa6944bba8e6c55742790fed32dd680","scripts":{"ncu":"yarn-tool ncu -u","lint":"ynpx --quiet eslint -- **/*.ts","test":"jest --passWithNoTests","coverage":"yarn run test -- --coverage","test:tsd":"ynpx tsd","test:jest":"jest --passWithNoTests","preversion":"echo preversion && yarn run test","test:mocha":"ynpx --quiet -p ts-node -p mocha mocha -- --require ts-node/register \"!(node_modules)/**/*.{test,spec}.{ts,tsx}\"","test:snapshot":"yarn run test -- -u","tsc:showConfig":"ynpx get-current-tsconfig -p","sort-package-json":"yarn-tool sort","test:jest:coverage":"yarn run test:jest -- --coverage","test:jest:snapshot":"yarn run test:jest -- -u","prepublishOnly:update":"yarn run ncu && yarn run sort-package-json"},"_npmUser":{"name":"bluelovers","email":"codelovers@users.sourceforge.net"},"repository":{"url":"git+https://github.com/bluelovers/ws-yarn-workspaces.git","type":"git","directory":"packages/@yarn-tool/get-paths-by-type"},"_npmVersion":"lerna/9.0.7/node@v24.14.0+x64 (win32)","description":"根據類型 Symbol 取得對應的路徑陣列（支援全域 npm/yarn 路徑） / Get corresponding path array based on type Symbol (supports global npm/yarn paths)","directories":{},"_nodeVersion":"24.14.0","dependencies":{"tslib":">=2","@yarn-tool/fnm-detect":"^1.0.6","@yarn-tool/get-global-dirs":"^1.0.4"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/get-paths-by-type_2.0.17_1777234475360_0.5226691752942347","host":"s3://npm-registry-packages-npm-production"},"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":1777234475506,"_cnpm_publish_time":1777234475506,"dist-tags":{"latest":"2.0.26"}}