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 🙏

© 2025 – Pkg Stats / Ryan Hefner

yarnd

v2.0.2

Published

Deduplication utility for yarn

Downloads

1,215

Readme

Yarnd

Deduplication utility for yarn

yarn add --dev yarnd

Why?

Yarn encourage reliability and works really well for this purpose. But sometimes when you want to update some direct dependencies yarn doesn't update transitive dependencies that already in use in other package. Therefore you can get two or more the same packages installed. For web bundles it's sometimes crucial to get only one or at least as less as possible identical dependencies. Because of possible errors and bigger bundle size if several duplicated dependencies present. So you have four choices:

  1. Remove yarn.lock entirely and install again (Worst)
  2. Update lock.file manually (Error prone)
  3. Add and remove dependency directly (Worked, but not convenient)
  4. Use utility to deduplicate packages in lock.file (like this)

Examples

  1. yarnd or yarnd check Show all dependencies that have duplicates that can be automatically deduplicated by semver
  2. yarnd fix Deduplicates all dependencies in automatic mode by semver
  3. yarnd @emotion/ react react-dom Are the same as -1- but check only dependencies in @emotion namespace and react, react-dom packages
  4. yarnd fix --primary react Same as -3- but deduplicate only dependencies that transitively connected with dependencies that listed in package.json in dependencies field and react package

Commands

Check for duplicated packages in yarn.lock and raise an error if there any (default):

yarnd check [packages]

Deduplicate specific packages or all if packages are not provided

yarnd fix [packages] 

Default command can be run either by command name or only with the name of the package (yarnd ...)

Warning: After yarnd fix - yarnd run yarn install --force because yarn balances file in it's own way and this command must be run after yarnd

Common flags
  • --lock [file] Specifies where the yarn.lock file is placed (default is a file in the current directory)
  • --included [packages] Specifies included dependencies (not transitive)
  • --excluded [packages] Specifies excluded dependencies (not transitive)
  • --primary Check production dependencies (transitive)
  • --dev Check development dependencies (transitive)
  • help Show available commands and description for them

--included [packages], --primary, --dev work applicative, so every command will add packages to check-list.

Check flags
  • --strict more verbose output that shows dependencies that cannot be deduplicated by semver. (filtered by previous commands)
Namespaces

--included [packages], --excluded [packages] also accept namespaces

Example: --excluded @babel/ - exclude all @babel namespace.

Aliases

All flags have aliases by the first letter, so these are equal commands:

  • yarnd fix -ps
  • yarnd fix -p -s
  • yarnd fix --primary --strict