
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
package-dependency-stats
Advanced tools
Gets the npm reigstry stats for all the dependencies in a package.json object. Also see gh-repo-dependencies.
npm install package-dependency-stats --save
var packageStats = require('package-dependency-stats')
var readPackage = require('read-closest-package')
readPackage(function (err, data) {
if (err) throw err
packageStats(data, {
filter: function (pkg) {
return pkg.list === 'dependencies'
}
}, function (err, deps) {
if (err) throw err
// print dependency name and registry description
deps = deps.map(function (d) {
return d.name + ': ' + d.stats.description
})
console.log(deps.join('\n'))
})
})
packageDepStats(packageJson, [opt], [cb])Fetches npm registry stats from the dependencies in packageJson (an object).
Options:
filter (Function) optionally filter the dependencies before querying npm registryFor example, filter could look like this to avoid querying registry stats of devDependencies.
function filterDeps (package) {
return package.list === 'dependencies'
}
The callback takes the form (err, data), where data is a flat array of dependencies gleaned from dependencies, devDependencies, peerDependencies, optionalDependencies (in that order) unless otherwise filtered.
Each item has the following data:
{
name: 'inherits', // name as it appears in package.json
version: '^2.0.1', // version range from package.json
list: 'dependencies', // type of dependency
stats: { ... } // registry stats
error: Error // Error object if there was a problem
}
If stats could not be retrieved for that package, it will be null and error will be populated with the Error object. Otherwise error will not be defined.
The stats are fetched using npm-stats.
Note: packageJson can be a simple object like so:
{
dependencies: { ... },
devDependencies: { ... }
}
MIT, see LICENSE.md for details.
FAQs
get reigstry stats of all package.json dependencies
The npm package package-dependency-stats receives a total of 3 weekly downloads. As such, package-dependency-stats popularity was classified as not popular.
We found that package-dependency-stats demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.