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

yaarlang

v1.0.1

Published

A simple programming language built with JavaScript

Readme

YaarLang 🇮🇳

A toy programming language with Hinglish keywords, built from scratch in JavaScript. YaarLang source is lexed, parsed into an AST, compiled down to plain JavaScript, and executed on Node.

maan_lo x = 10
maan_lo y = 20

maan_lo sum = x + y
bol sum

Requirements

Install

npm install -g yaarlang

This gives you the yaarlang command anywhere on your machine.

You can also run it without installing globally:

npx yaarlang path/to/file.yl

Quick Start

yaarlang path/to/file.yl

If you cloned the repo instead of installing from npm, run:

npm start

which executes node index.js examples/hello.yl.

Language Guide

| Keyword | Meaning | Example | |------------|---------------------------------|----------------------------------------| | maan_lo | Declare a variable | maan_lo x = 10 | | bol | Print a value | bol x | | sun | Read input from the user | maan_lo name = sun("Naam? ") | | agar | if | agar x > 5 { bol "bada" } | | nahito | else | nahito { bol "chhota" } | | jabtak | while loop | jabtak i <= 5 { bol i } | | kaam | Declare a function | kaam add(a, b) { wapis a + b } | | wapis | return | wapis a + b | | jodo | Push into an array | jodo(nums, 5) / jodo(nums, 5, 0) | | nikalo | Remove from an array | nikalo(nums) / nikalo(nums, 0) | | lambai | Length of an array | bol lambai(nums) | | galti | Throw an error | galti "Age cannot be negative" |

Operators

  • Arithmetic: +, -, *, /, unary -
  • Comparison: ==, !=, <, >, <=, >=
  • Logical: &&, ||
  • Assignment: =

Arrays

maan_lo nums = [10, 20, 30]
bol nums[0]
nums[1] = 99
bol nums
bol lambai(nums)

Comments

// this is a comment
maan_lo x = 10 // inline comment

Everything together

maan_lo age = 20

agar age >= 18 {
  bol 'Bada ho gaya'
} nahito {
  bol 'Abhi chhota hai'
}

maan_lo i = 1
jabtak i <= 5 {
  bol i
  i = i + 1
}

kaam add(a, b) {
  wapis a + b
}
bol add(3, 4)

maan_lo nums = [10, 20, 30]
jodo(nums, 40)
nikalo(nums, 0)
bol nums

Booleans produced by comparisons (agar x == y) print as sach (true) / jhoot (false).

How It Works

Source code flows through a small compiler pipeline:

  1. lexer.js — turns raw source text into a stream of tokens (keywords, identifiers, numbers, strings, operators).
  2. parser.js — turns tokens into an AST (declarations, if/while, functions, arrays, etc.).
  3. codegen.js — walks the AST and emits equivalent JavaScript source.
  4. compiler.js — wires the lexer, parser, and codegen together.
  5. runtime.js — executes the generated JavaScript via eval.
  6. index.js — CLI entry point: reads a .yl file, compiles it, and runs it.

Project Structure

YaarLang/
├── index.js        # CLI entry point
├── compiler.js      # Pipes lexer -> parser -> codegen
├── lexer.js         # Source text -> tokens
├── parser.js        # Tokens -> AST
├── codegen.js        # AST -> JavaScript source
├── runtime.js         # Executes generated JavaScript
└── examples/
    ├── hello.yl        # Minimal sample program
    └── test.yl         # Larger sample covering most language features

Status

This is an early, minimal implementation intended for learning how compilers/interpreters work. Currently supported: variable declarations, printing, input, string/number literals, arithmetic/comparison/logical expressions, if/else, while loops, functions with return, arrays (literals, indexing, push/remove, length), throw-style errors, and // comments.

Contributing

Issues and pull requests are welcome at the GitHub repo.

License

MIT