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

brainrotscript

v1.1.0

Published

🧠 A brainrot programming language that compiles to JavaScript - because why write normal code when you can write code that's absolutely sending you? πŸ’€

Downloads

16

Readme

🧠 BrainrotScript

A brainrot programming language that compiles to JavaScript. Because why write normal code when you can write code that's absolutely sending you? πŸ’€

What is BrainrotScript?

BrainrotScript (.brainrot) is a programming language that uses Gen Z/brainrot slang as keywords instead of traditional programming keywords. It compiles directly to JavaScript, so you get all the power of JS but with the rizz of brainrot terminology.

Installation

# Install globally from npm (coming soon!)
npm install -g brainrotscript

# Or install locally for development
npm install

Quick Start

  1. Write your brainrot code in a .brainrot file:
job_application greet(name) {
    vibe_check (name) {
        console.log("Hello, " + name + "! No cap! 🧒");
    } big_yikes {
        console.log("Hello, anonymous user!");
    }
}

greet("World");
  1. Run it directly:
# Method 1: Direct execution (if installed globally)
brainrot index.brainrot

# Method 2: Using the run command
brainrot run index.brainrot

# Method 3: Local development
node bin/brs-cli.js index.brainrot
  1. Or compile to JavaScript:
brainrot compile index.brainrot -o output.js

Keyword Mappings πŸ—ΊοΈ

| JavaScript | BrainrotScript | Example | |------------|----------------|---------| | function | job_application | job_application greet() {} | | return | its_giving | its_giving result; | | const | lock_in | lock_in name = "Chad"; | | let | whatever | whatever count = 0; | | if | vibe_check | vibe_check (condition) {} | | else | big_yikes | big_yikes { console.log("nah"); } | | for | flex | flex (whatever i = 0; i < 10; i++) {} | | while | goon | goon (condition) {} | | class | squad | squad MyClass {} | | this | me_fr | me_fr.property = value; | | true | wallahi | lock_in isTrue = wallahi; | | false | no_cap | lock_in isFalse = no_cap; | | null | ghost | lock_in empty = ghost; | | try | fuck_around | fuck_around { /* code */ } | | catch | caught_4k | caught_4k (error) {} | | async | brb | brb job_application getData() {} | | await | hold_up | hold_up response; | | new | spawn | lock_in obj = spawn MyClass(); | | extends | inherits_drip | squad Child inherits_drip Parent |

View complete mapping in brainrot-map.json

CLI Commands

# Run a .brainrot file directly
brainrot <file.brainrot>

# Run with explicit run command
brainrot run <file.brainrot>

# Compile to JavaScript  
brainrot compile <file.brainrot> [-o output.js]

# Show all available keywords
brainrot keywords

# Show help
brainrot --help

Examples

Basic Example (examples/hello.brainrot)

job_application main() {
    lock_in message = "Hello from BrainrotScript!";
    console.log(message);
    
    vibe_check (wallahi) {
        console.log("This condition is true - no cap! 🧒");
    }
    
    flex (whatever i = 0; i < 3; i++) {
        console.log(`Loop ${i + 1}: Still got the rizz! πŸ”₯`);
    }
}

main();

Advanced Example (examples/advanced.brainrot)

squad VibeManager {
    job_application constructor(vibes) {
        me_fr.vibes = vibes || 0;
    }
    
    brb job_application addVibes(amount) {
        hold_up new Promise(resolve => {
            me_fr.vibes += amount;
            resolve(me_fr.vibes);
        });
    }
}

brb job_application main() {
    fuck_around {
        lock_in manager = spawn VibeManager(100);
        hold_up manager.addVibes(200);
        console.log("Total vibes:", manager.vibes);
    } caught_4k (error) {
        console.error("Something went wrong:", error);
    }
}

main();

How It Works

  1. Lexical Translation: The compiler reads your .brs file and replaces all brainrot keywords with their JavaScript equivalents using regex with word boundaries
  2. Compilation: The translated code is saved as a .js file
  3. Execution: Node.js runs the compiled JavaScript
  4. Cleanup: Temporary files are automatically removed

Development

# Test with the hello world example
npm test

# Run a specific example
brainrot examples/advanced.brainrot

# Check available keywords
brainrot keywords

File Structure

brainrotscript/
β”œβ”€β”€ src/
β”‚   └── compiler.js          # Core compiler logic
β”œβ”€β”€ bin/
β”‚   └── brs-cli.js          # CLI interface
β”œβ”€β”€ examples/
β”‚   β”œβ”€β”€ hello.brainrot      # Basic example
β”‚   └── advanced.brainrot   # Advanced features
β”œβ”€β”€ brainrot-map.json       # Keyword mappings
β”œβ”€β”€ package.json
└── README.md

Contributing

Want to add more brainrot keywords? Edit brainrot-map.json and the compiler will automatically use them!

License

MIT - Use this however you want, just don't blame us if your code reviews get spicy 🌢️


Built with πŸ’€ and excessive amounts of brainrot

"It's giving main character energy but make it programming" - BrainrotScript Users, probably