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

brocode-cli

v2.0.6

Published

A compiler for BroCode programming language - Code in Hindi style syntax

Downloads

64

Readme

BROCODE

A toy programming language for Bros that allows you to write code using Hindi-style syntax. It makes programming more accessible and fun for Hindi speakers! 🎉


Documentation

For detailed documentation, check out the official BROCODE documentation:

BROCODE Documentation


Official Website

Visit the official website for BROCODE:

BROCODE Official Website


Installation

npm install -g brocode-cli@latest

Usage

1. Create a file with a .bc extension:

// hello.bc
// A basic program to find the factorial of a number

bro function FACTORIAL(n) {
    bro maanle fact hai 1;
    bro maanle i hai 1;

    bro jbb tk (i <= n) hai {
        bro maanle fact hai fact * i;
        i++;
    }

    bro dikha de("Factorial of " + n + " is: " + fact);
}

FACTORIAL(5);

2. Run your code:

brocode your-file.bc

OR

npx brocode your-file.bc

Command Line Options

  • Basic usage: brocode filename.bc
  • Debug mode: brocode filename.bc --debug

Features

  • Hindi-style syntax for better understanding
  • Clear error messages
  • Debug mode for development
  • Easy to use CLI interface

BROCODE syntax

1. Declaring a Variable:

// Declaring variable 'num' and assigning value 5
bro maanle num hai 5;

2. Print something:

bro dikha de("Hello World!");

3. Function Declaration:

bro function <functionName>(pram_a, param_b) {
    bro dikha de(pram_a + param_b);
}

<functionName>(5, 3);

4. Conditional Statements:

//Declaring num with 2
bro maanle num hai 2;

// if statement
bro agar (num < 3){
    bro dikha de("Number is less than 3");
}
//else statement
bro leave it{
    bro dikha de("Number is greater than 3");
}

5. While Loop:

// Declaring initial value from where loop starts
bro maanle num hai 2;

// defining while loop with condition num < 3
bro jbb tk (num < 3) hai {
    bro dikha de(num);

    // break statement
    bro nikal;

    // incrementing num
    num++;
}

How to Setup DOM with BROCODE

To set up DOM functionality in your project, follow these steps:

  1. Add this in the <head> tag:
<script src="https://brocode-cli.vercel.app/api/ajj-kuch-tufani-krte-hai"></script>
  1. Create a <bro-script> tag at the end of your body tag:
<bro-script src="index.bc"></bro-script>

Make sure to provide the correct path to your .bc file.

That's it! You're good to go. 🎉

BROCODE DOM Statements

Select an element by its ID

bro ye id ("<id>") wala lake <variable> me rakhde;

Select an element using a CSS selector

bro isko ("<selector>") uthake <variable> me rakhde;

Select all elements matching a CSS selector

bro iske ("<selector>") jese sab uthake <variable> me rakhde;

Change the inner HTML of an element

bro <element> ka html bdl ke ("<new content>") krde;

Change the text content of an element

bro <element> ka text bdl ke ("<new content>") krde;

Set an attribute value on an element

bro <element> ka attribute ("<name>", "<value>") set krde;

Get an attribute value from an element

bro <element> ka attribute ("<name>") le aa;

Remove an attribute from an element

bro <element> ka attribute ("<name>") hta de;

Change the style property of an element

bro <element> ka <property> "<value>" krde;

Add a class to an element

bro <element> ki classes me "<className>" add krde;

Remove a class from an element

bro <element> ki classes me "<className>" remove krde;

Toggle a class on an element

bro <element> ki classes me "<className>" toggle krde;

Add an event listener to an element

bro <element> pe sun ("<event>", <function()>);

Remove an event listener from an element

bro <element> pe sunna bnd kr ("<event>", <function()>);

Create a new element

bro document me "<tagName>" ka nya element <variable> me bna de;

Append a child element to a parent element

bro <element> me <childElement> append krde;

Remove an element from the DOM

bro <element> hta de;

Get the parent node of an element

bro <element> ka parent <variable> me rakhde;

Get the child elements of an element

bro <element> ka children <variable> me rakhde;

Get the value of a form input element

bro <inputElement> ki value <variable> me rakhde;

Scroll an element into view

bro <element> me scroll krde;

Scroll the window to a specific position

bro window ko (x, y) tkk scroll krde;

See what BROCODE can do:

Yes now you can make basic web applications with BROCODE 💀

To-Do-list made with html,css and BROCODE

License

MIT License - see LICENSE file for details.