npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

hacker-deps

v0.1.1

Published

print out which hackers your application depends on

Downloads

7

Readme

hacker-deps

Print the list of hackers your application depends on.

example

For a quick list of hackers, just do hacker-deps $APP_ROOT:

$ hacker-deps ~/projects/substack.net
 42.7%    James Halliday (substack)
 14.5%    Dominic Tarr (dominictarr)
  6.9%    Raynos (Raynos)
  5.0%    undefined
  4.5%    Isaac Z. Schlueter (isaacs)
  2.7%    Joshua Holbrook (jesusabdullah)
  2.1%    Max Ogden (maxogden)
  1.9%    ariya (ariya)
  1.8%    ForbesLindesay (ForbesLindesay)
  1.8%    johnny (NHQ)
  1.7%    Tim Caswell (creationix)
  1.6%    Constellation (Constellation)
  1.3%    Thorsten Lorenz (thlorenz)
  1.3%    Robert Kieffer (broofa)
  1.3%    Roman Shtylman (shtylman)
  1.2%    TJ Holowaychuk (visionmedia)
  1.2%    Nick Fitzgerald (mozilla)
  0.9%    Christopher Jeffrey (chjj)
  0.9%    Alex Gorbatchev (alexgorbatchev)
  0.9%    James Burke (jrburke)
  0.7%    Julian Gruber (juliangruber)
  0.4%    Mathias Bynens (bestiejs)
  0.4%    mishoo (mishoo)
  0.4%    Brian J. Brennan (brianloveswords)
  0.4%    Romain Beauxis (toots)
  0.3%    T. Jameson Little (beatgammit)

hacker-deps finds all package.json files and finds who wrote each non-private package depended on in your application.

In this list the percentage is a normalized sum of all the packages in the dependency graph weighted by distance to give a rough estimate of how reliant your application is on the work of each hacker in the results.

To supplement the list of hackers with lists of packages, add --verbose:

$ hacker-deps ~/projects/substack.net --verbose | head -n30

 42.7%    James Halliday (substack)

    falafel          brfs                   http-browserify     resolve
    vm-browserify    browser-pack           commondir           astw
    lexical-scope    insert-module-globals  detective           module-deps
    wordwrap         optimist               parents             shell-quote
    syntax-error     browserify             deck                ent
    comandante       git-file               internet-timestamp  mkdirp
    ordered-emitter  duplex-pipe            http-duplex         pushover
    glog             hyperquest             hyperglue           hyperspace
    buffers          trumpet                baudio

 14.5%    Dominic Tarr (dominictarr)

    through       JSONStream    crypto-browserify  from
    map-stream    pause-stream  split              stream-combiner
    event-stream

  6.9%    Raynos (Raynos)

    console-browserify  duplexer  class-list

  5.0%    undefined

    custom        skip  lexical-scope-test  indexof
    substack.net

  4.5%    Isaac Z. Schlueter (isaacs)

    inherits  sax

You can also print the list of modules ranked by module score with --modules:

$ hacker-deps ~/projects/substack.net --modules | head -n20
findit      12.0 %  James Halliday (substack)
hyperquest  12.0 %  James Halliday (substack)
walk-fs     12.0 %  skoni (skoni)
optimist    12.0 %  James Halliday (substack)
text-table  12.0 %  James Halliday (substack)
through      6.0 %  Dominic Tarr (dominictarr)
duplexer     6.0 %  Raynos (Raynos)
seq          6.0 %  James Halliday (substack)
wordwrap     6.0 %  James Halliday (substack)
minimist     6.0 %  James Halliday (substack)
traverse     4.0 %  James Halliday (substack)
chainsaw     3.0 %  James Halliday (substack)
hashish      3.0 %  James Halliday (substack)

usage

usage: hacker-deps OPTIONS

OPTIONS are:

  -v, --verbose     Verbose module output for the default output mode
  -m, --modules     List the normalized weights of each module used.
  -b, --budget      Hypothetical amount to budget for open source.
  -s, --socialism   Coefficient of socialism for --budget (default: 1.5)

methods

var hdeps = require('hacker-deps')

hdeps(root, cb)

Compute the hacker dependencies starting at the application path root.

cb(err, hackers) fires once the complete graph has been traced with hackers, an array of entries sorted by a contribution score. Each row looks like:

{
  name: 'Dominic Tarr',
  github: 'dominictarr',
  packages: {
    split: 1.5,
    through: 3.1666666666666665,
    'vec2-dom': 1,
    'vec2-layout': 2,
    example: 2,
    rec2: 0.5,
    hyperscript: 0.5
  },
  score: 0.24436807941962585
}

The score is a normalized contribution score that shows how reliant your application is on this author.

The packages object is non-normalized package data according to the sum of 1/(2 * distance) where distance is the number of dependencies up the dependency hierarchy. The assumption here is that modules that are further away are probably less crucial to your application.

install

With npm do:

npm install -g hacker-deps

license

MIT