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

code-easter-eggs

v1.0.1

Published

Add hidden easter eggs and cheat codes to your website easily ๐Ÿฅš

Readme

๐Ÿฅš code-easter-eggs (eggify)

Add hidden easter eggs and cheat codes to your website with one line.

npm install code-easter-eggs

Features

  • Lightweight (~1-2 KB gzipped)
  • Browser-only (requires DOM and KeyboardEvent API)
  • Custom cheat code patterns
  • Optional key delay limit
  • Works with AbortController
  • Ignores input/textarea by default
  • Works with modern bundlers (Webpack, Vite, etc.)

Platform Support

  • โœ… Browsers (Chrome, Firefox, Safari, Edge)
  • โœ… Electron apps
  • โœ… Browser extensions
  • โŒ Node.js (server-side)
  • โŒ React Native
  • โŒ Terminal applications

How to use it

ESM (Browser/Bundler)

import { onCheatCode } from "code-easter-eggs";

onCheatCode("โ†‘โ†‘โ†“โ†“โ†โ†’โ†โ†’BA", () => {
  alert("๐Ÿฅš Secret unlocked!");
});

CJS (Bundler with CommonJS)

const { onCheatCode } = require("code-easter-eggs");
// Note: Still requires browser environment
onCheatCode("โ†‘โ†‘โ†“โ†“โ†โ†’โ†โ†’BA", () => {
  console.log("hi!");
});

Browser (UMD/IIFE)

<script src="https://unpkg.com/code-easter-eggs/dist/index.global.js"></script>
<script>

  Eggify.onCheatCode("โ†‘โ†‘โ†“โ†“โ†โ†’โ†โ†’BA", () => alert("๐Ÿฅš"));

  window.onCheatCode("โ†‘โ†‘โ†“โ†“โ†โ†’โ†โ†’BA", () => alert("๐Ÿฅš (shim)"));
</script>

Global

import "code-easter-eggs";
window.onCheatCode!("โ†‘โ†‘โ†“โ†“โ†โ†’โ†โ†’BA", () => { /* ... */ });

Different ways to introduce codes

Secret code

onCheatCode("โ†‘โ†‘โ†“โ†“โ†โ†’โ†โ†’BA", () => {
  alert("๐Ÿฅš Secret unlocked!");
});

Key code

onCheatCode('ArrowUp ArrowUp ArrowDown ArrowDown ArrowLeft ArrowRight ArrowLeft ArrowRight b a', () => {
  showEasterEgg('FAMOUS CODE!<br/>30 Lives Unlocked! ๐ŸŽฎ', '๐Ÿ•น๏ธ');
});
// Secret code --> dev mode 
onCheatCode('KeyD keyE keyV Space KeyM KeyO KeyD KeyE', () => {
    showEasterEgg('Developer Mode ON<br/>Console access granted! ๐Ÿ‘จโ€๐Ÿ’ป', '๐Ÿ’ป');
});

Simple word cheat code

onCheatCode('eggify', () => {
    showEasterEgg('You found the Eggify secret! ๐Ÿฅšโœจ', '๐Ÿฅš');
});

Number sequence

onCheatCode('1 2 3 4 5', () => {
    showEasterEgg('Numbers are magic! ๐Ÿ”ขโœจ', '๐Ÿ”ข');
});

Collaborate

# build
npm run build

# create local package
npm pack

# test in other project
mkdir ../eggify-test && cd ../eggify-test
npm init -y
npm install ../ruta/a/eggify-1.0.0.tgz

# link to dev
npm link
# in eggify-test/
npm link eggify

# serve html example
npx http-server ./local-browser-test -p 4000
# open http://localhost:4000

Size check

npm install -g gzip-size-cli

gzip-size dist/index.js dist/index.cjs dist/index.global.js

1.26 kB

๐Ÿง  AI Usage Notice

AI was used as a tool for assistance โ€” for example, to write comments, extract certain types, or configure some options.
However, this is NOT an AI-driven coding project.

If you wish to contribute code that involves AI assistance, please add a comment at the end of the file stating:

// Contains AI-generated code

so it can be reviewed in more detail.

(Fragment created using AI)

I will add custom instructions for copilot in the near future

License

Beerware ๐Ÿบ โ€” do whatever you want with it, but if we meet, buy me a beer. (This is essentially MIT-like. Use it freely, but if we meet, buy me a beer)