{"name":"package-json-from-dist","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"package-json-from-dist","version":"1.0.0","description":"Load the local package.json from either src or dist folder","main":"./dist/commonjs/index.js","exports":{"./package.json":"./package.json",".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}}},"scripts":{"preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","prepare":"tshy","pretest":"npm run prepare","presnap":"npm run prepare","test":"tap","snap":"tap","format":"prettier --write . --loglevel warn --ignore-path ../../.prettierignore --cache","typedoc":"typedoc"},"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://izs.me"},"license":"BlueOak-1.0.0","repository":{"type":"git","url":"git+https://github.com/isaacs/package-json-from-dist.git"},"devDependencies":{"@types/node":"^20.12.12","prettier":"^3.2.5","tap":"^18.5.3","typedoc":"^0.24.8","typescript":"^5.1.6","tshy":"^1.14.0"},"prettier":{"semi":false,"printWidth":70,"tabWidth":2,"useTabs":false,"singleQuote":true,"jsxSingleQuote":false,"bracketSameLine":true,"arrowParens":"avoid","endOfLine":"lf","experimentalTernaries":true},"tshy":{"exports":{"./package.json":"./package.json",".":"./src/index.ts"}},"types":"./dist/commonjs/index.d.ts","type":"module","_id":"package-json-from-dist@1.0.0","gitHead":"b5d50a5510b66886238de2a0d508987da17bb7d8","bugs":{"url":"https://github.com/isaacs/package-json-from-dist/issues"},"_nodeVersion":"20.11.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==","shasum":"e501cd3094b278495eb4258d4c9f6d5ac3019f00","tarball":"http://localhost:4260/package-json-from-dist/package-json-from-dist-1.0.0.tgz","fileCount":13,"unpackedSize":33940,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBk1UxJB1c1W5JqTwhuKr1Dnao3WgyeqtoSK5jKUvZyTAiEA8nD3BvBEUOi8z1O5qVay68RDTcOeH1op6kTxNdKi7CI="}]},"directories":{},"_hasShrinkwrap":false}},"description":"Load the local package.json from either src or dist folder","homepage":"https://github.com/isaacs/package-json-from-dist#readme","repository":{"type":"git","url":"git+https://github.com/isaacs/package-json-from-dist.git"},"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://izs.me"},"bugs":{"url":"https://github.com/isaacs/package-json-from-dist/issues"},"license":"BlueOak-1.0.0","readme":"#package-json-from-dist\n\nSometimesyouwanttoloadthe`package.json`intoyour\nTypeScriptprogram,andit'stemptingtojust`import\n'../package.json'`,sincethatseemstowork.\n\nHowever,thisrequires`tsc`tomakeanentirecopyofyour\n`package.json`fileintothe`dist`folder,whichisaproblemif\nyou'reusingsomethinglike\n[tshy](https://github.com/isaacs/tshy), which uses the\n`package.json` file in dist for another purpose. Even when that\ndoes work, it's asking the module system to do a bunch of extra\nfs system calls, just to load a version number or something. (See\n[this issue](https://github.com/isaacs/tshy/issues/61).)\n\nThis module helps by just finding the package.json file\nappropriately, and reading and parsing it in the most normal\nfashion.\n\n## Caveats\n\nThis *only* works if your code builds into a target folder called\n`dist`, which is in the root of the package. It also requires\nthat you do not have a folder named `node_modules` anywhere\nwithin your dev environment, or else it'll get the wrong answers\nthere. (But, at least, that'll be in dev, so you're pretty likely\nto notice.)\n\nIf you build to some other location, then you'll need a different\napproach. (Feel free to fork this module and make it your own, or\njust put the code right inline, there's not much of it.)\n\n## USAGE\n\n```js\n// src/index.ts\nimport { findPackageJson, loadPackageJson } from 'package-json-from-dist'\n\nconst pj = findPackageJson(impor