Socket
Book a DemoInstallSign in
Socket

dependent-counts

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dependent-counts

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

latest
Source
npmnpm
Version
2.0.0
Version published
Maintainers
1
Created
Source

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

FAQs

Package last updated on 26 Dec 2016

Did you know?

Socket

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.

Install

Related posts