Gathering detailed insights and metrics for packument
Gathering detailed insights and metrics for packument
npm install packument
Typescript
Module System
Min. Node Version
Node Version
NPM Version
82.5
Supply Chain
91.2
Quality
74.6
Maintenance
100
Vulnerability
99.6
License
JavaScript (100%)
Total Downloads
3,182,696
Last Day
1,871
Last Week
8,244
Last Month
38,211
Last Year
667,919
2 Stars
12 Commits
1 Watching
3 Branches
1 Contributors
Minified
Minified + Gzipped
Latest Version
2.0.0
Package Id
packument@2.0.0
Unpacked Size
5.77 kB
Size
2.63 kB
File Count
4
NPM Version
7.21.1
Node Version
16.9.1
Cumulative downloads
Total Downloads
Last day
-3.9%
1,871
Compared to previous day
Last week
-21.5%
8,244
Compared to previous week
Last month
-11%
38,211
Compared to previous month
Last year
25.5%
667,919
Compared to previous year
3
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
.
1const packument = require('packument') 2 3packument('levelup', (err, result) => { 4 if (err) throw err 5 console.log(result.versions['2.0.2'].dependencies) 6})
packument(name[, opts], callback)
Callback receives an error if any, a packument and response headers. Options:
headers
: custom headers (you can override any)keepAlive
: shortcut for headers: { connection: 'keep-alive' }
full
: if true, fetch full metadata rather than an abbreviated document.packument = packument.factory(opts)
Preconfigure the function. For example, to always fetch full metadata:
1const packument = require('packument').factory({ full: true }) 2 3packument('levelup', (err, result) => { 4 if (err) throw err 5 console.log(result._rev) 6})
Combine it with an in-memory cache:
1const memoize = require('thunky-with-args') 2const packument = memoize(require('packument').factory({ full: true })) 3 4packument('levelup', (err, result) => { 5 // It will make only one request 6}) 7 8packument('levelup', (err, result) => { 9 // Subsequent calls for the same package are cached 10})
Reuse that cache in other modules:
1const memoize = require('thunky-with-args') 2const packument = memoize(require('packument')) 3const getPackage = require('packument-package').factory(packument) 4 5getPackage('levelup', '~2.0.0', function (err, pkg) { 6 if (err) throw err 7 console.log(pkg.version) 8})
With npm do:
npm install packument
MIT © Vincent Weevers
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/10 approved changesets -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More