{"_id":"get-current-package","_rev":"3758002","name":"get-current-package","description":"Get the package.json of the currently executing bin.","dist-tags":{"latest":"1.0.1"},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"time":{"modified":"2025-03-18T07:12:51.000Z","created":"2023-02-09T20:20:20.400Z","1.0.1":"2025-01-12T18:47:46.865Z","1.0.0":"2023-02-09T20:20:20.400Z"},"users":{},"repository":{"type":"git","url":"git+https://github.com/fabiospampinato/get-current-package.git"},"versions":{"1.0.1":{"name":"get-current-package","repository":{"type":"git","url":"git+https://github.com/fabiospampinato/get-current-package.git"},"description":"Get the package.json of the currently executing bin.","license":"MIT","version":"1.0.1","type":"module","main":"dist/index.js","exports":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"clean":"tsex clean","compile":"tsex compile","compile:watch":"tsex compile --watch","test":"tsex test","test:watch":"tsex test --watch","prepublishOnly":"tsex prepare"},"keywords":["cli","get","current","package"],"dependencies":{"find-up-json":"^2.0.5"},"devDependencies":{"@types/node":"^18.19.70","fava":"^0.3.4","tsex":"^4.0.2","typescript":"^5.7.3"},"_id":"get-current-package@1.0.1","gitHead":"1000d2cc179bb9022f20ac96bd0b09fb05144f24","bugs":{"url":"https://github.com/fabiospampinato/get-current-package/issues"},"homepage":"https://github.com/fabiospampinato/get-current-package#readme","_nodeVersion":"18.19.0","_npmVersion":"10.2.3","dist":{"shasum":"5d29ec4262169977f363ae97d2a992423ae9f0be","size":1846,"noattachment":false,"key":"/get-current-package/-/get-current-package-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/get-current-package/download/get-current-package-1.0.1.tgz"},"_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"directories":{},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/get-current-package_1.0.1_1736707666694_0.7647259555424886"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-01-12T18:47:46.865Z","publish_time":1736707666865,"_source_registry_name":"default","_cnpm_publish_time":1736707666865},"1.0.0":{"name":"get-current-package","repository":{"type":"git","url":"git+https://github.com/fabiospampinato/get-current-package.git"},"description":"Get the package.json of the currently executing bin.","version":"1.0.0","type":"module","main":"dist/index.js","exports":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"clean":"tsex clean","compile":"tsex compile","compile:watch":"tsex compile --watch","test":"tsex test","test:watch":"tsex test --watch","prepublishOnly":"npm run clean && npm run compile && npm run test"},"keywords":["cli","get","current","package"],"dependencies":{"find-up-json":"^2.0.1"},"devDependencies":{"@types/node":"^18.13.0","fava":"^0.0.8","tsex":"^1.1.5","typescript":"^4.9.5"},"gitHead":"6b4e1ba6ce91e0b4840e3edddde6f20d24771246","bugs":{"url":"https://github.com/fabiospampinato/get-current-package/issues"},"homepage":"https://github.com/fabiospampinato/get-current-package#readme","_id":"get-current-package@1.0.0","_nodeVersion":"18.12.0","_npmVersion":"8.19.2","dist":{"shasum":"503679737b9247aec825efe45591fd0a1ab20f6d","size":2221,"noattachment":false,"key":"/get-current-package/-/get-current-package-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/get-current-package/download/get-current-package-1.0.0.tgz"},"_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"directories":{},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/get-current-package_1.0.0_1675974020224_0.054558864058529055"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-02-09T20:20:20.400Z","publish_time":1675974020400,"_cnpm_publish_time":1675974020400}},"readme":"# Get Current Package\n\nGet the `package.json` of the currently executing bin.\n\nThis is meant to be used in combination with [`tiny-updater`](https://github.com/fabiospampinato/tiny-updater) or similar, in order to get the name and the version of the currently executing bin very conveniently, without importing a \"package.json\" and without hard-coding the values yourself.\n\n## Install\n\n```sh\nnpm install get-current-package\n```\n\n## Usage\n\nYou should have something like this in your bin app:\n\n```ts\nimport getCurrentPackage from 'get-current-package';\n\nconsole.log ( getCurrentPackage () );\n```\n\nThen executing the bin would produce this:\n\n```\n> my-bin\n< { name: 'my-bin', version: '1.0.0', ... }\n```\n\nBasically it detects which entrypoint file is being executed and retrieves its `package.json`.\n\n## License\n\nMIT © Fabio Spampinato\n","_attachments":{},"homepage":"https://github.com/fabiospampinato/get-current-package#readme","bugs":{"url":"https://github.com/fabiospampinato/get-current-package/issues"},"license":"MIT"}