Skip to content

💯 Get counts of how many packages depend on the given package. Works offline.

Notifications You must be signed in to change notification settings

nice-registry/dependent-counts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dependent-counts

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

Installation

npm install dependent-counts --save

Usage

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()
})

Tests

npm install
npm test

Dependencies

None

Dev Dependencies

  • 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

License

MIT

Generated by package-json-to-readme

About

💯 Get counts of how many packages depend on the given package. Works offline.

Resources

Stars

Watchers

Forks

Packages

No packages published