{"name":"@yarn-tool/resolve-package","version":"3.0.16","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"],"author":"","license":"ISC","_id":"@yarn-tool/resolve-package@3.0.16","maintainers":[{"name":"bluelovers","email":"codelovers@users.sourceforge.net"}],"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"},"dist":{"shasum":"072a3e5be670c708f38ad6ed4a6e497fe7980797","tarball":"http://registry-npm.ywwl.com/@yarn-tool/resolve-package/download/@yarn-tool/resolve-package-3.0.16.tgz","fileCount":6,"integrity":"sha512-6tiW74e2gTSDY2d/JHyhBWpY+pRhcGRt8DN6cXkKszsQ3S7Sd49qn8ai3baslMLwMNiwJk0mJ+ZKaOY0Z6X+Gg==","signatures":[{"sig":"MEUCICZ0Ubcn/jkV35KlJCWRsz121qsfIGTqtA2DdT+ZPA/mAiEAgNO2Aul6k5BVHN0x2Xn4oQG46cpF6W84n/vE/x5E8HI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIDQpDiuKEYsT0PYsAWeoG8IK3q45e60kbv7KMV/6FGcLAiEA4LANZ3azDSz6UuUZKq3EzF0goVwOkDHi4y5ucovI+mU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":37048,"size":9074,"noattachment":false,"key":"/@yarn-tool/resolve-package/-/@yarn-tool/resolve-package-3.0.16.tgz"},"main":"index.js","types":"./index.d.ts","gitHead":"7cf909b7ad668ebec4654d70b8837c280cabdb3b","scripts":{"ncu":"npx yarn-tool ncu -u","lint":"npx eslint **/*.ts","test":"node --run test:node","tsc:esm":"tsc -p tsconfig.esm.json","coverage":"npx nyc pnpm run test","test:tsc":"tsc --noEmit & echo typescript check done","test:tsd":"ynpx tsd","test:jest":"jest --passWithNoTests","test:node":"tsx --test --test-update-snapshots **/*.node-spec.ts **/*.node-test.ts **/*.spec.ts **/*.test.ts","preversion":"pnpm run test","test:mocha":"npx mocha --require ts-node/register \"!(node_modules)/**/*.{test,spec}.{ts,tsx}\"","npm:publish":"npm publish","tsc:default":"tsc -p tsconfig.json","postpublish_":"git commit -m \"chore(release): publish\" .","test:tsc:all":"node --run test:tsc && node --run test:tsc:sub","test:tsc:sub":"cd test && tsc --noEmit & echo Type checking completed (test)","test:node:bin":"tsx --test --test-update-snapshots --","test:snapshot":"pnpm run test -u","prepublishOnly":"echo prepublishOnly","tsc:showConfig":"ynpx get-current-tsconfig -p","sort-package-json":"npx yarn-tool sort","test:jest:coverage":"pnpm run test:jest -- --coverage","test:jest:snapshot":"pnpm run test:jest -- -u","prepublish:lockfile":"npx sync-lockfile .","test:node:bin:coverage":"node --run test:node:bin -- --experimental-test-coverage --"},"_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/resolve-package"},"_npmVersion":"lerna/7.4.2/node@v26.13.0+x64 (win32)","description":"解析 Node.js 套件的根目錄與 package.json 路徑的工具庫 / A utility for resolving package root and package.json paths","directories":{},"_nodeVersion":"26.13.0","dependencies":{"tslib":">=2.8.1","@yarn-tool/require-resolve":"^4.0.15"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/resolve-package_3.0.16_1793736771431_0.05198830531337917","host":"s3://npm-registry-packages-npm-production"},"readme":"# @yarn-tool/resolve-package\n\n> This package is deprecated, use @yarn-tool/require-resolve instead\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## 功能特色 (Features)\n\n- `resolvePackageJsonLocation()` - 取得套件的 `package.json` 檔案路徑\n- `resolvePackageRoot()` - 取得套件根目錄 (Package root)\n- `resolvePackage()` - 一次取得根目錄、入口點、`package.json` 內容與路徑解析函式\n- `createResolveLocationFn()` - 建立相對於套件根目錄的路徑解析函式\n- `readModulePackageJson()` - 讀取模組的 `package.json` 內容\n- 相容 Node.js 17 以上版本，並重新匯出 (Re-export) `@yarn-tool/require-resolve` 的完整 API\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)\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 文件 (API Documentation)\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## 設定 (Configuration)\n\n本套件沒有設定檔 (Config file)，所有行為皆透過各函式第二個參數 `options`（`IOptionsRequireResolve`）控制，例如指定解析的起始目錄或自訂解析條件。相關選項型別與實作細節請參考來源套件 [@yarn-tool/require-resolve](../require-resolve)。\n\n其他路徑查找 (Path finding) 相關工具請參考 [路徑工具模組](../docs/find-path-tools.md)。\n\n## License\n\nISC\n","publish_time":1793736771542,"_cnpm_publish_time":1793736771542,"dist-tags":{"latest":"3.0.17"}}