{"name":"@yarn-tool/get-paths-by-type","version":"2.0.6","keywords":["yarn","yarn-tool","npm","lerna","workspaces","pkg","dependencies","monorepo","yarnlock","node-modules","packages","package"],"author":{"name":"bluelovers"},"license":"ISC","_id":"@yarn-tool/get-paths-by-type@2.0.6","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":"64da6b75e8437d5044c59b52a5d62f3be1602ab9","tarball":"http://registry-npm.ywwl.com/@yarn-tool/get-paths-by-type/download/@yarn-tool/get-paths-by-type-2.0.6.tgz","fileCount":6,"integrity":"sha512-/I8mVd8/5iL64pue6tKzCxgEsboASoMiGS4XpRbp6ehrG6QmH92SQOmmLZ89AsFD/fbuqOljl1/qJeFt2FOKcA==","signatures":[{"sig":"MEUCIQCepdJOMApDqmDJB+Jk9lF+onP1iLrzzx2VnMSWeiBkmQIgMHXc9cb3GhtWOz6V8m+nVum9Ji5/UUTX2kRLztC2yII=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":10445,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNf9vACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpp7A/8CESGa+0Zax8c/orpuaPWsLzwNXwQEeeAPBfXVXrJQVTiSf14\r\n9MTTFKVN3pTpLjS2Pp7hnkCiFiy1Zt59qal+cWid+pYYGhisNj04P+k+XhSU\r\nqAfQp6DAv+zyI37H0/fQAEdU4gE3o4NFXJtZTsKwyMtQ1Z6Eggkx5p3kxmH1\r\nkgnNI3C0jKMPGG1Pcl6rIrjCvPj+rnAgBh5HLzGsthXPZJ07ccj1unuR+H3C\r\nv9sEL2xBHi4ghMB856Q9t/JhnQxXQkAKE2CH1pbaN4K9DPT1RSCHYQ21TIuu\r\nG9vpdp41U5rI8XRY/aSGXSlIw7hGXm0HKdspAqnhyewHW3ME65uA+5uigRR2\r\nJQAsLYLi0+v9waJSRZ+6W8+/b9D4+HB7MuXNvzGj/P1sx1jkl4TJehRuJgDS\r\n0Ft87T8MMG1FLyl8wHwI4U7qjOTV23Eg93S4qogIjqXx8dnxZ4PIe61m197o\r\na6DA96y3Mj2+tDRv7a9eu1fR4iR4MMU2z4vf6gAtR18++cTbKwEJh6LSg51J\r\nY/nYGQZpFG1QPwZGCyXR4AKZI/jKps4OITdIEJRtbciqqOVyfApZ9uUoLZ00\r\nDx/dx12hm3fdChi0cId92WZichaI84BPfWoau0FcGRYs7ebCxk8Ed6E9NVXW\r\nfHgnAdn5OsbGnAJH1gM0FiqrPlM5lW/s6Eo=\r\n=Jx+6\r\n-----END PGP SIGNATURE-----\r\n","size":3247,"noattachment":false,"key":"/@yarn-tool/get-paths-by-type/-/@yarn-tool/get-paths-by-type-2.0.6.tgz"},"main":"index.js","types":"./index.d.ts","gitHead":"3276b7881ad407d6da75804fee95de66d602805c","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: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/5.5.1/node@v18.10.0+x64 (win32)","description":"","directories":{},"_nodeVersion":"18.10.0","dependencies":{"tslib":">=2","global-dirs":"^3.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"yarn@1.22.19","_npmOperationalInternal":{"tmp":"tmp/get-paths-by-type_2.0.6_1664483183092_0.7714755299936753","host":"s3://npm-registry-packages"},"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":1664483183318,"_cnpm_publish_time":1664483183318,"dist-tags":{"latest":"2.0.26"}}