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

@jishaanyazmi/code-script

v1.0.2

Published

A beginner-friendly programming language that transpiles to JavaScript

Readme


What is CodeScript?

CodeScript is a lightweight, readable programming language that compiles to JavaScript. It replaces confusing syntax with plain English keywords so beginners can focus on learning programming logic instead of fighting the language.

Every .code file you write is transpiled into clean, readable JavaScript and executed by Node.js.

make name = "Zishan"

do greet(person){
    say("Hello " + person)
    give person
}

greet(name)
// Generated JavaScript
let name = "Zishan";

function greet(person){
    console.log("Hello " + person);
    return person;
}

greet(name);

Website

Visit the official CodeScript website for documentation, examples, and more:

👉 codescript-cli.netlify.app


Why CodeScript?

| Problem | CodeScript Solution | |---|---| | console.log is confusing | Use say instead | | let, const, var are unclear | Use make and fixed | | function keyword is verbose | Use do | | this is confusing | Use me | | try/catch/finally is intimidating | Use attempt/oops/done | | new keyword feels magical | Use create | | null and undefined are unclear | Use empty and unknown |


Installation

Requirements: Node.js 18 or higher

npm install -g @codescript/cli

Verify installation:

codescript --version

Quick Start

1. Create your first file

# Create hello.code
say("Hello, World!")

2. Run it

codescript hello.code

Output:

Hello, World!

CLI Commands

| Command | Description | |---|---| | codescript <file.code> | Compile and run a file | | codescript build <file.code> | Compile only — outputs a .js file | | codescript watch <file.code> | Watch for changes and recompile automatically | | codescript init | Scaffold a new CodeScript project | | codescript --version | Show the installed version | | codescript --help | Show usage information |


Compiler Pipeline

Every .code file passes through these stages before execution:

Source (.code)
      │
      ▼
    Lexer          →  Converts characters into tokens
      │
      ▼
   Parser          →  Converts tokens into an AST
      │
      ▼
     AST            →  Abstract Syntax Tree (program structure)
      │
      ▼
 Semantic Analyzer  →  Validates scope, types, and rules
      │
      ▼
  Optimizer         →  Constant folding, dead code removal
      │
      ▼
JS Generator        →  Emits clean JavaScript
      │
      ▼
  Node.js           →  Executes the output

Keyword Reference

Variables & Constants

| Keyword | JavaScript | Description | |---|---|---| | make | let | Declares a mutable variable | | fixed | const | Declares an immutable constant — must be initialized | | keep | var | Legacy variable — function scoped, avoid in new code |

make age = 20
fixed PI = 3.14159
keep counter = 0

Functions

| Keyword | JavaScript | Description | |---|---|---| | do | function | Declares a reusable function | | give | return | Returns a value from a function | | later | async | Marks a function as asynchronous | | wait | await | Waits for an async operation to complete |

do add(a, b){
    give a + b
}

later do fetchData(url){
    make result = wait fetch(url)
    give result
}

Output & Input

| Keyword | JavaScript | Description | |---|---|---| | say | console.log | Prints a value to the console |

say("Hello World")
say(42)
say(user.name)

Conditions

| Keyword | JavaScript | Description | |---|---|---| | check | if | Executes a block when the condition is true | | otherwise | else | Executes when the check condition is false | | pick | switch | Selects one path from multiple options | | when | case | Defines a single case inside a pick block | | anyway | default | The fallback case inside a pick block |

check(age >= 18){
    say("Adult")
}otherwise{
    say("Minor")
}

pick(day){
    when "Monday"{
        say("Start of the week")
    }
    when "Friday"{
        say("Almost weekend")
    }
    anyway{
        say("Regular day")
    }
}

Loops

| Keyword | JavaScript | Description | |---|---|---| | repeat | for | Repeats a block a set number of times | | until | while | Repeats while a condition is true | | stop | break | Exits the nearest loop immediately | | skip | continue | Skips the current iteration and continues |

repeat(make i = 0; i < 5; i++){
    say(i)
}

make count = 0
until(count < 10){
    say(count)
    count++
}

repeat(make i = 0; i < 10; i++){
    check(i == 5){ stop }
    check(i == 3){ skip }
    say(i)
}

Classes & OOP

| Keyword | JavaScript | Description | |---|---|---| | type | class | Declares a class | | from | extends | Inherits from a parent class | | create | new | Creates a new instance of a class | | me | this | Refers to the current object instance | | parent | super | Calls the parent class constructor or method | | shared | static | Declares a static method or property | | mine | private | Marks a member as private | | everyone | public | Marks a member as public | | family | protected | Marks a member as protected |

type Animal{
    do constructor(name){
        me.name = name
    }
    do speak(){
        say("I am " + me.name)
    }
}

type Dog from Animal{
    do constructor(name){
        parent(name)
    }
}

make dog = create Dog("Rex")
dog.speak()

Error Handling

| Keyword | JavaScript | Description | |---|---|---| | attempt | try | Wraps code that might throw an error | | oops | catch | Handles the error if one is thrown | | panic | throw | Throws an error and stops execution | | done | finally | Always runs after attempt/oops, error or not |

attempt{
    panic "Something went wrong"
}oops(err){
    say(err)
}done{
    say("Finished")
}

Modules

| Keyword | JavaScript | Description | |---|---|---| | grab | import | Imports code from another .code file | | share | export | Exports variables, functions, or classes |

// math.code
do add(a, b){
    give a + b
}
share add

// main.code
grab { add } from "./math.code"
say(add(5, 3))

Boolean & Null Values

| Keyword | JavaScript | Description | |---|---|---| | yes | true | Boolean true value | | no | false | Boolean false value | | empty | null | Represents an intentionally absent value | | unknown | undefined | Represents an uninitialized value |

make loggedIn = yes
make guest = no
make user = empty
make value = unknown

Utility Keywords

| Keyword | JavaScript | Description | |---|---|---| | kind | typeof | Returns the type of a value as a string | | is | instanceof | Checks if an object is an instance of a class | | remove | delete | Deletes a property from an object |

say(kind age)           // "number"
say(dog is Animal)      // true
remove user.email

Complete Example

// Variables
make name = "Zishan"
fixed PI = 3.14

// Function
do greet(person){
    say("Hello " + person)
    give person
}

greet(name)

// Condition
check(PI > 3){
    say("PI is greater than 3")
}otherwise{
    say("PI is small")
}

// Loop
repeat(make i = 1; i < 4; i++){
    say(i)
}

// Array
make fruits = ["Apple", "Banana", "Orange"]
say(fruits[0])

// Object
make user = { name: "Alex", age: 20 }
say(user.name)

// Class
type Animal{
    do constructor(name){
        me.name = name
    }
    do speak(){
        say("I am " + me.name)
    }
}

type Dog from Animal{
    do constructor(name){
        parent(name)
    }
}

make dog = create Dog("Rex")
dog.speak()

// Error Handling
attempt{
    panic "something went wrong"
}oops(err){
    say(err)
}done{
    say("finished")
}

Output:

Hello Zishan
PI is greater than 3
1
2
3
Apple
Alex
I am Rex
something went wrong
finished

Project Structure

codescript/
├── packages/
│   ├── cli/          CLI — command line interface
│   ├── compiler/     Compiler orchestrator
│   ├── lexer/        Lexer — source to tokens
│   ├── tokenizer/    Token type definitions
│   ├── parser/       Parser — tokens to AST
│   ├── ast/          AST node definitions
│   ├── semantic/     Semantic analyzer
│   ├── optimizer/    AST optimizer
│   ├── generator/    JavaScript code generator
│   ├── resolver/     Module resolver
│   ├── stdlib/       Standard library
│   └── shared/       Shared utilities
├── examples/         Example .code programs
├── tests/            Automated tests
├── docs/             Language documentation
└── README.md

Error Messages

CodeScript produces beginner-friendly compiler errors with file, line, column, and a suggested fix.

SyntaxError
File: hello.code
Line: 12
Column: 8
Message: Expected '}' but found ')'
Suggestion: Close the previous block before ending the function.

License

MIT © Mohd Jishaan Azmi