{"_id":"packument","_rev":"3816893","name":"packument","description":"Fetch package metadata from the npm registry","dist-tags":{"latest":"2.0.0"},"maintainers":[{"name":"vweevers","email":""}],"time":{"modified":"2025-06-05T11:32:16.000Z","created":"2018-04-28T14:10:05.843Z","2.0.0":"2022-01-29T10:44:21.724Z","1.0.0":"2018-04-28T14:10:05.843Z"},"users":{},"author":{"name":"Vincent Weevers"},"repository":{"type":"git","url":"git+https://github.com/vweevers/packument.git"},"versions":{"2.0.0":{"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":{"shasum":"ceb9cbce9a6a61e02fdfaffe42ccb2c44476d6d6","size":2690,"noattachment":false,"key":"/packument/-/packument-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/packument/download/packument-2.0.0.tgz"},"_npmUser":{"name":"vweevers","email":"dev@vincentweevers.nl"},"directories":{},"maintainers":[{"name":"vweevers","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/packument_2.0.0_1643453061602_0.16396219549872848"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-01-29T10:44:34.769Z","publish_time":1643453061724,"_cnpm_publish_time":1643453061724},"1.0.0":{"name":"packument","version":"1.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":"~3.3.2","registry-url":"~3.1.0","simple-get":"~3.0.2"},"devDependencies":{"nock":"~9.2.5","standard":"~11.0.1","tape":"~4.9.0"},"keywords":["npm","package","packument","registry"],"engines":{"node":">=6"},"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":"50396ada141de40bf4afc042ef82ac8c1406e097","_id":"packument@1.0.0","_shasum":"63a7502c456d675bd31a65307fdf5f74e49a1141","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.8.0","_npmUser":{"name":"vweevers","email":"dev@vincentweevers.nl"},"maintainers":[{"name":"vweevers","email":""}],"dist":{"shasum":"63a7502c456d675bd31a65307fdf5f74e49a1141","size":3586,"noattachment":false,"key":"/packument/-/packument-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/packument/download/packument-1.0.0.tgz"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/packument_1.0.0_1524924605757_0.5514917411458826"},"_hasShrinkwrap":false,"publish_time":1524924605843,"_cnpm_publish_time":1524924605843,"_cnpmcore_publish_time":"2021-12-17T01:33:57.001Z"}},"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 status](http://img.shields.io/npm/v/packument.svg?style=flat-square)](https://www.npmjs.org/package/packument)\n[![node](https://img.shields.io/node/v/packument.svg?style=flat-square)](https://www.npmjs.org/package/packument)\n[![Travis build status](https://img.shields.io/travis/vweevers/packument.svg?style=flat-square&label=travis)](http://travis-ci.org/vweevers/packument)\n[![AppVeyor build status](https://img.shields.io/appveyor/ci/vweevers/packument.svg?style=flat-square&label=appveyor)](https://ci.appveyor.com/project/vweevers/packument)\n[![Dependency status](https://img.shields.io/david/vweevers/packument.svg?style=flat-square)](https://david-dm.org/vweevers/packument)\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg?style=flat-square)](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)\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","_attachments":{},"homepage":"https://github.com/vweevers/packument","bugs":{"url":"https://github.com/vweevers/packument/issues"},"license":"MIT"}