Get counts of how many packages depend on the given package. Works offline.
If you need the actual package names (and not just counts), see dependent-packages
npm install dependent-counts --save
const test = require('tape')
const counts = require('.')
test('counts', function (t) {
t.ok(Array.isArray(counts), 'is an array')
t.ok(counts.length > 30 * 1000, 'has hella entries')
t.comment('every count')
t.ok(counts.every(count => count.name.length > 0), 'has a name')
t.ok(counts.every(count => count.dependents > -1), 'has a dependents count')
t.ok(counts.every(count => count.devDependents > -1), 'has a dependents count')
t.comment('express')
t.ok(counts.find(count => count.name === 'express').dependents > 10000, 'has a dependents count')
t.ok(counts.find(count => count.name === 'express').devDependents > 1000, 'has a devDependents count')
t.end()
})
npm install
npm test
None
- dependent-packages: Offline collection of the dependents and devDependents of every package in the npm registry.
- require-dir: Helper to require() directories.
- tap-spec: Formatted TAP output like Mocha's spec reporter
- tape: tap-producing test harness for node and browsers
MIT
Generated by package-json-to-readme