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

lucky-package

v2.0.2

Published

Feeling lucky? Try installing a random npm package

Readme

🎁 lucky-package

Feeling lucky? Try installing a random npm package

⚠️ Disclaimer

While lucky-package performs security checks before installing anything, there's no guaranteed safety; a malicious or vulnerable package could still exist that has no security vulnerabilities publicly disclosed and passes all the checks. For more details, see Security concerns section.

📥 Installation

npm install -g lucky-package

🧐 Examples

Install a random package:

$ lucky-package install

  [1/4] 🔎 Searching for a lucky package...
  [2/4] 🎉 Found it! shittier
  [3/4] 🚀 Installing...
  
  added 25 packages in 4s
  
  [4/4] ✅ Installed successfully! Run lucky-package --help to see all options

Install several random packages at once:

lucky-package install --amount=3

Undo the most recent installation:

lucky-package rollback

Feeling ✨ extra ✨ lucky? Try providing the --unsafe flag to include potentially dangerous packages in the search. Good luck 🙂🙏

lucky-package install --unsafe

📖 Usage

| Command | Alias | Options | Description | |------------|-------|----------------------------------|---------------------------------------------------------------------------------------------------------| | install | i | -a, --amount <number> | Number of random packages to install. Default: 1 | | | | -u, --unsafe | Disables all preinstall security checks to include potentially dangerous packages in the search | | | | -g, --global | Install packages globally | | rollback | r | -l, --last (default behaviour) | Uninstall the most recent installed package(s) by lucky-package | | | | -a, --all | Uninstall all packages installed by lucky-package | | config | c | -a, --audit <boolean> | Specify whether to run npm audit after installation. Default: false |

👮 Security concerns

Preinstall security checks

By default, lucky-package uses npq to analyze each package before installation. This handy tool covers a range of security checks. The following checks from npq are being used:

  1. Scripts — Excludes packages that have pre/post install script (which could potentially be malicious).
  2. Snyk — Excludes packages that have been found with vulnerabilities in Snyk's database.
  3. Typosquatting — Excludes packages with names similar to popular packages. See typosquatting.

Why only these three checks?

Running every npq check and finding a package that passes all of them can be very slow, which could ruin the fun! The checks are balanced for speed and safety.

Using --unsafe option

The --unsafe option disables all preinstall security checks mentioned above. This can lead to the installation of risky or malicious packages and is not recommended unless you know what you're doing.

Postinstall security checks

By default, npm audit is disabled with the --no-audit flag during installation, so you won't see audit messages like these:

audited 262 packages in 2s

found 0 vulnerabilities

Why is npm audit disabled by default?

The npm audit command is disabled by default to enhance the installation speed of your packages. Since security checks are already performed during the pre-installation phase using npq, running npm audit afterward can prolong the process. If you prefer to enable this additional layer of security, you can easily configure the audit option:

lucky-package config --audit=true