{"name":"@yarn-tool/resolve-package","version":"3.0.10","description":"解析 Node.js 套件的根目錄與 package.json 路徑的工具庫 / A utility for resolving package root and package.json paths","keywords":["yarn-tool","pkg-dir","upath2","resolve","package","json","root","npm","entry","find","up","find-up","findup","look-up","look","file","search","match","parent","parents","folder","directory","walk","walking","path"],"homepage":"https://github.com/bluelovers/ws-yarn-workspaces/tree/master/packages/@yarn-tool/resolve-package#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/resolve-package"},"license":"ISC","author":"","main":"index.js","scripts":{"coverage":"npx nyc pnpm run test","lint":"npx eslint **/*.ts","test":"node --run test:jest --","test:jest":"jest --passWithNoTests","test:jest:coverage":"pnpm run test:jest -- --coverage","test:jest:snapshot":"pnpm run test:jest -- -u","test:mocha":"npx mocha --require ts-node/register \"!(node_modules)/**/*.{test,spec}.{ts,tsx}\"","test:snapshot":"pnpm run test -u","test:tsd":"ynpx tsd","npm:publish":"npm publish","preversion":"pnpm run test","prepublish:lockfile":"npx sync-lockfile .","prepublishOnly":"echo prepublishOnly","postpublish_":"git commit -m \"chore(release): publish\" .","ncu":"npx yarn-tool ncu -u","sort-package-json":"npx yarn-tool sort","tsc:default":"tsc -p tsconfig.json","tsc:esm":"tsc -p tsconfig.esm.json","tsc:showConfig":"ynpx get-current-tsconfig -p"},"dependencies":{"@yarn-tool/require-resolve":"^4.0.9","tslib":">=2.8.1"},"devDependencies":{"@ts-type/package-dts":"^3.0.9"},"publishConfig":{"access":"public"},"gitHead":"008888d233d299e89673cbc45a2712ba9bf825c1","types":"./index.d.ts","_id":"@yarn-tool/resolve-package@3.0.10","_nodeVersion":"26.7.0","_npmVersion":"lerna/7.4.2/node@v26.7.0+x64 (win32)","dist":{"integrity":"sha512-Wq/AuA79LFJr1/EniFW5OL2jATESZHlRxoPc3rxq3DlE4oT0umgFDZHNxRTXFL6ALXDP3nlcrJBvJgfbftun9w==","shasum":"cd0866371ef71c608fa0eb65a80eba5c8032274b","tarball":"http://registry-npm.ywwl.com/@yarn-tool/resolve-package/download/@yarn-tool/resolve-package-3.0.10.tgz","fileCount":6,"unpackedSize":33580,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCkNPAPVhUlN3k6E8TLRCclX7muojldWRwDUni6VfLCbQIhAIFGTHJowDRAfhJBxU+km7kKYh61eth5Eg+NU/LwF7D4"}],"size":7810,"noattachment":false,"key":"/@yarn-tool/resolve-package/-/@yarn-tool/resolve-package-3.0.10.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/resolve-package_3.0.10_1788737155659_0.2994500024543094"},"_hasShrinkwrap":false,"readme":"# @yarn-tool/resolve-package\n\n解析 Node.js 套件的根目錄與 package.json 路徑的工具庫，支援 Node.js 17 以上版本。\nA utility for resolving package root and package.json paths, compatible with Node.js 17+.\n\n## 安裝 (Installation)\n\n```bash\n# 使用 yarn / Using yarn\nyarn add @yarn-tool/resolve-package\n\n# 使用 yarn-tool / Using yarn-tool\nyarn-tool add @yarn-tool/resolve-package\n# yt 是 yarn-tool 的別名 / yt is an alias for yarn-tool\nyt add @yarn-tool/resolve-package\n\n# 使用 pnpm / Using pnpm\npnpm add @yarn-tool/resolve-package\n\n# 使用 npm / Using npm\nnpm install @yarn-tool/resolve-package\n```\n\n## 使用範例 (Usage Example)\n\n```typescript\nimport { resolvePackageJsonLocation, resolvePackage, resolvePackageRoot } from '@yarn-tool/resolve-package'\n\n// 取得套件的 package.json 路徑 / Get package.json path\nconsole.dir(resolvePackageJsonLocation('tslib'));\n\n// 取得套件根目錄 / Get package root directory\nconsole.dir(resolvePackageRoot('tslib'));\n\n// 取得完整套件資訊 / Get complete package information\nconst pkg = resolvePackage('tslib');\nconsole.dir(pkg.pkgRoot);        // 套件根目錄 / Package root\nconsole.dir(pkg.pkgJsonLocation); // package.json 路徑 / package.json path\nconsole.dir(pkg.pkg);            // package.json 內容 / package.json content\nconsole.dir(pkg.resolveLocation('lib/index.js')); // 相對路徑解析 / Resolve relative path\n```\n\n## API\n\n### `resolvePackageCore(moduleName, options?)`\n\n核心解析函數，嘗試解析模組的入口點位置。\n\n### `resolvePackageRoot(moduleName, options?)`\n\n取得套件的根目錄路徑。\n\n### `resolvePackageJsonLocation(moduleName, options?)`\n\n取得套件的 package.json 檔案位置。\n\n### `createResolveLocationFn(moduleName, options?)`\n\n建立一個相對於套件根目錄解析路徑的函數。\n\n### `readModulePackageJson(moduleName, options?)`\n\n讀取並返回模組的 package.json 內容。\n\n### `resolvePackage(moduleName, options?)`\n\n最完整的解析函數，返回套件根目錄、入口點、package.json 內容及路徑解析函數。\n\n## License\n\nISC","publish_time":1788737155784,"_cnpm_publish_time":1788737155784,"dist-tags":{"latest":"3.0.17"}}