{"name":"packument","version":"2.0.0","description":"Fetch package metadata from the npm registry","license":"MIT","author":{"name":"Vincent Weevers"},"scripts":{"test":"standard && node test"},"dependencies":{"registry-auth-token":"^4.2.1","registry-url":"^5.1.0","simple-get":"^4.0.1"},"devDependencies":{"nock":"^13.2.2","standard":"^16.0.4","tape":"^5.5.0"},"keywords":["npm","package","packument","registry"],"engines":{"node":">=10"},"repository":{"type":"git","url":"git+https://github.com/vweevers/packument.git"},"bugs":{"url":"https://github.com/vweevers/packument/issues"},"homepage":"https://github.com/vweevers/packument","gitHead":"11190c4fe96e6c924f1e20ae656d369aae7b59e7","_id":"packument@2.0.0","_nodeVersion":"16.9.1","_npmVersion":"7.21.1","dist":{"integrity":"sha512-sTJ8gktDrIh0afD1y4SfILeEe0zp+W8N6aFFfWQCGacny2L7d5vt//+mIyWSmlHpizLvkMuDpjeN1Z37O2G1AQ==","shasum":"ceb9cbce9a6a61e02fdfaffe42ccb2c44476d6d6","tarball":"http://registry-npm.ywwl.com/packument/download/packument-2.0.0.tgz","fileCount":4,"unpackedSize":5906,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh9RqFCRA9TVsSAnZWagAAPbkP/RKdLvrVMhm4DNb7hxg5\npaqEbasn0cz6fkALrux8/QUL1DgsJTwLOHEG+94oYS2ByAfLXIaMx9A78eim\n3wBpFjp8xm7SR/s4EWAnoFr0Wxj/Ay1wSZzyFL7S8p3L11XYBjUxcroEKUKg\nLbsL8Kv6pIWwTOTbLnIkZ+1HAWmAsk7FX30hd/ba8VveI2zV7Kq8V88HgC6N\nSSVsSNOul5zdG22xcVgTz04f+B5oZTKPu1PHjMTkBDnVIRPIW9wgU29djQ9a\nhKhbUZjIrcmcFkPy6E82m9Cimy1Y1/awSqEz4TRM5+dm9KKapMySgF5Yr6X3\n7fcj+UnhWM/07sxRINSGRCQJ3O26eNRoKQW3ul7hAEoqrOEd0iEsnYhr6rLZ\nf9OPmiE4XAswCtl7jc99POM9/61fLAEN1nONVJ/5Yv+lID9fG3yRpqFQb/v1\nlfhpkI9F6PIKlBKoWEidk1JKzsenfbKqQQwiI6Cl1nC+HRxnHIgp3xFnl4Ja\nexfU2c/66Usd8vKJ0GSEvxslLvAT9MbbcoylOfRoQEgDmjUGB8gduhgk69Zw\nxS89WIKIY5lk0MJWoLiX1jjRDvyak3CKC9ZXLHpDqwYPX+cSSHQBCTcUfAJ+\ncR8ee4I/MKyFPcxiP56hEKsEiInurgAAdeSj/5BQTUCQ+I45WJT9olUw3bTh\nwf2K\r\n=/npx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDN5BiPYWlRVYauqSUUM3CnoFIldub2NLl4ZsT2kaY+HgIgOof3nW73KakxvLNQZYXPPhtUdBam/DQUczR3tJ1Cebg="}],"size":2690,"noattachment":false,"key":"/packument/-/packument-2.0.0.tgz"},"_npmUser":{"name":"vweevers","email":"dev@vincentweevers.nl"},"directories":{},"maintainers":[{"name":"vweevers","email":"dev@vincentweevers.nl"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/packument_2.0.0_1643453061602_0.16396219549872848"},"_hasShrinkwrap":false,"readme":"# packument\n\n**Fetch package metadata from the npm registry. Supports scopes and private registries. If you only need the metadata of a specific version, use [`packument-package`](https://www.npmjs.org/package/packument-package).**\n\n[![npm](https://img.shields.io/npm/v/packument.svg)](https://www.npmjs.com/package/packument)\n[![node](https://img.shields.io/node/v/packument.svg)](https://www.npmjs.com/package/packument)\n[![Test](https://img.shields.io/github/workflow/status/vweevers/packument/Test?label=test)](https://github.com/vweevers/packument/actions/workflows/test.yml)\n[![Standard](https://img.shields.io/badge/standard-informational?logo=javascript&logoColor=fff)](https://standardjs.com)\n\n## example\n\n```js\nconst packument = require('packument')\n\npackument('levelup', (err, result) => {\n  if (err) throw err\n  console.log(result.versions['2.0.2'].dependencies)\n})\n```\n\n## `packument(name[, opts], callback)`\n\nCallback receives an error if any, a packument and response headers. Options:\n\n- `headers`: custom headers (you can override any)\n- `keepAlive`: shortcut for `headers: { connection: 'keep-alive' }`\n- `full`: if true, fetch full metadata rather than an [abbreviated document](https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md).\n\n## `packument = packument.factory(opts)`\n\nPreconfigure the function. For example, to always fetch full metadata:\n\n```js\nconst packument = require('packument').factory({ full: true })\n\npackument('levelup', (err, result) => {\n  if (err) throw err\n  console.log(result._rev)\n})\n```\n\nCombine it with an in-memory cache:\n\n```js\nconst memoize = require('thunky-with-args')\nconst packument = memoize(require('packument').factory({ full: true }))\n\npackument('levelup', (err, result) => {\n  // It will make only one request\n})\n\npackument('levelup', (err, result) => {\n  // Subsequent calls for the same package are cached\n})\n```\n\nReuse that cache in other modules:\n\n```js\nconst memoize = require('thunky-with-args')\nconst packument = memoize(require('packument'))\nconst getPackage = require('packument-package').factory(packument)\n\ngetPackage('levelup', '~2.0.0', function (err, pkg) {\n  if (err) throw err\n  console.log(pkg.version)\n})\n```\n\n## install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install packument\n```\n\n## license\n\n[MIT](http://opensource.org/licenses/MIT) © Vincent Weevers\n","publish_time":1643453061724,"_cnpm_publish_time":1643453061724,"dist-tags":{"latest":"2.0.0"}}