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 🙏

© 2026 – Pkg Stats / Ryan Hefner

deduper

v0.3.0

Published

Dedupes packages with identical names and version numbers match based on a given requirement.

Readme

deduper build status

Dedupes packages with identical names and version numbers match based on a given requirement.

var deduper = require('deduper')();

var orig_id = '/orig/pack';
var match_id = '/match/pack';
var nomatch_id = '/nomatch/pack';

var pack_1_1_1 = { name: 'pack', version: '1.1.1', n: 1 };
var pack_1_1_2 = { name: 'pack', version: '1.1.2', n: 2 };
var pack_1_2_1 = { name: 'pack', version: '1.2.1', n: 3 };

var orig = deduper.dedupe('minor', orig_id, pack_1_1_1);
var match = deduper.dedupe('minor', match_id, pack_1_1_2);
var nomatch = deduper.dedupe('minor', nomatch_id, pack_1_2_1);

console.log({ orig: orig, match: match, nomatch: nomatch });
{ orig:
   { id: '/orig/pack',
     pack: { name: 'pack', version: '1.1.1', n: 1 } },
  match:
   { id: '/orig/pack',
     pack: { name: 'pack', version: '1.1.1', n: 1 } },
  nomatch:
   { id: '/nomatch/pack',
     pack: { name: 'pack', version: '1.2.1', n: 3 } } }

Installation

npm install deduper

API

###deduper([cache])

/**
 * Creates new deduper instance with its own cache
 * 
 * @name Deduper
 * @function
 * @param cache {Object} (optional) provides a cache to use, if not supplied a new cache is created
 * @return {Deduper} instance
 */

###deduper.dedupe(criteria, id, pack)

/**
 * Caches packages and returns cached versions if the package name is found in the cache and the versions are considered
 * compatible considering the given criteria.
 * 
 * @name exports
 * @function
 * @param criteria {String} one of the following - most to least specific: exact | patch | minor | major | any
 * @param id {String} identification for the package (i.e. its full path)
 * @param pack {Object} npm package metadata
 * @return {Object} with matching id and pack or the one that was given
 */

criteria

  • exact versions have to be equal
  • patch major and minor and patch numbers have to be equal, alpha, beta suffixes may vary
  • minor major and minor numbers have to be equal, patch number may vary
  • major major number has to be equal, minor and patch numbers may vary
  • any versions are not considered

###deduper.reset()

  • resets the package cache

License

MIT