{"name":"@yarn-tool/resolve-package","version":"3.0.2","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.2","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":"4d32eef6c340ecdd79dcabb2d0e71a265220e363","tarball":"http://registry-npm.ywwl.com/@yarn-tool/resolve-package/download/@yarn-tool/resolve-package-3.0.2.tgz","fileCount":6,"integrity":"sha512-Vzxmth9rQV8Q6eXiEVzZsGDcFsEdvqTlE0q651xBOXWUxxIGSuIkd9UQ4rmcX5oJlO3pMJp1IaAmwbgM8/5X/w==","signatures":[{"sig":"MEYCIQDbCq48+NtrziaoIap3ArG+kEofPvhBPuQmLD5LVD1E2QIhALpq7BOZXkLEkN7dGxqnmwihOsMJ/gPEPlSAeLArJVFh","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":29859,"size":7056,"noattachment":false,"key":"/@yarn-tool/resolve-package/-/@yarn-tool/resolve-package-3.0.2.tgz"},"main":"index.js","types":"./index.d.ts","gitHead":"2125b86f55c2db7b5a914e3ad84729e4021f1b7e","scripts":{"ncu":"npx yarn-tool ncu -u","lint":"npx eslint **/*.ts","test":"echo \"Error: no test specified\"","tsc:esm":"tsc -p tsconfig.esm.json","coverage":"npx nyc yarn run test","test:tsd":"ynpx tsd","test:jest":"jest --passWithNoTests","preversion":"yarn 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:snapshot":"yarn run test -- -u","prepublishOnly":"echo prepublishOnly","tsc:showConfig":"ynpx get-current-tsconfig -p","sort-package-json":"npx yarn-tool sort","test:jest:coverage":"yarn run test:jest -- --coverage","test:jest:snapshot":"yarn run test:jest -- -u","prepublish:lockfile":"npx sync-lockfile ."},"_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/6.6.2/node@v24.13.1+x64 (win32)","description":"解析 Node.js 套件的根目錄與 package.json 路徑的工具庫 / A utility for resolving package root and package.json paths","directories":{},"_nodeVersion":"24.13.1","dependencies":{"tslib":">=2","@yarn-tool/require-resolve":"^4.0.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@ts-type/package-dts":"^2.0.8"},"_npmOperationalInternal":{"tmp":"tmp/resolve-package_3.0.2_1772605295291_0.05090870187766616","host":"s3://npm-registry-packages-npm-production"},"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":1772605295444,"_cnpm_publish_time":1772605295444,"dist-tags":{"latest":"3.0.17"}}