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

@ugo-studio/jspp

v0.2.5

Published

A modern transpiler that converts JavaScript code into high-performance, standard C++23.

Readme

JSPP (JavaScript++)

CI License: MIT

JSPP is a modern, experimental transpiler that converts JavaScript code into high-performance, standard C++23.

The primary goal of this project is to achieve a near-perfect translation of JavaScript's dynamic nature and core features into the statically-typed, compiled world of C++, exploring modern C++ capabilities to bridge the gap between these two powerful languages.

About The Project

JavaScript is flexible and dynamic; C++ is performant and type-safe. JSPP aims to offer the best of both worlds. By transpiling JS to C++, we can potentially run JavaScript logic in environments where C++ is native, with significant performance gains and opportunities for low-level interoperability.

This project serves as a deep dive into compiler design, language semantics, and the expressive power of modern C++. The current implementation translates an entire JavaScript file into a single C++ main function, cleverly using std::shared_ptr<std::any> to replicate JavaScript's dynamic typing, garbage-collection-like memory management, and complex features like closures.

Features

JSPP currently supports a foundational set of JavaScript features:

  • Dynamic Variables: Declaration (let, const and var), assignment, and type changes at runtime.
  • Primitive Types: undefined, null, boolean, number, string, object and array.
  • Functions:
    • Function declarations and arrow functions.
    • Correct hoisting for both variables and functions.
    • Closures with proper lexical scoping and lifetime management.
  • Operators: All arithmetic (+, -, *) and assignment (=) operators.
  • Control Flow: void operator.
  • Built-in APIs: A console object with log(), warn(), error(), and time() methods.

Reserved Keywords

JSPP reserves certain keywords to avoid conflicts with the generated C++ code and internal mechanisms. The following keywords are reserved and cannot be used as variable names:

  • std: Reserved to prevent conflicts with the C++ standard library namespace.
  • jspp: Reserved for internal use by the JSPP transpiler.
  • co_yield,co_return,co_await: Reserved to prevent conflicts with the c++ couroutine keywords.

Using these keywords as variable names will result in a SyntaxError.

Installation

To use JSPP as a command-line tool, install it globally via npm:

npm i @ugo-studio/jspp -g

For Developers

To contribute to JSPP or run its test suite, follow these steps:

Prerequisites

  • Node.js: This project uses Node.js for package management and script execution.
  • C++ Compiler: A compiler with support for C++23 is required. This project is tested with g++.
    • g++ (MinGW on Windows, or available via build-essentials on Linux)

Setup

  1. Clone the repo:
    git clone https://github.com/ugo-studio/jspp.git
  2. Install dependencies:
    npm install

Usage

The primary way to use JSPP is via its command-line interface. This will transpile your .js file to C++, compile it, and execute the resulting binary.

jspp <path-to-your-js-file>

Example:

To run a sample JavaScript file located at my-code/hello.js:

jspp my-code/hello.js

The transpiled C++ file and executable will be generated in the same directory as the input file and cleaned up after execution.

You can also run the test suite, which will transpile all the JavaScript test cases in test/cases/, build the resulting C++ files, and run them.

npm test

Roadmap

This project is ambitious, and there is a long and exciting road ahead. Here is a high-level overview of the planned features and the project's current standing.


Phase 1: Core Language Features

This phase focuses on building a solid foundation that correctly models JavaScript's core runtime behavior.

  • [x] Dynamic Variables & Primitives (let, const, var, undefined, null, string, number, boolean, etc.)
  • [x] Function Declarations & Arrow Functions
  • [x] Correct Hoisting for Variables and Functions
  • [x] Closures & Lexical Scoping
  • [x] if-elseif-else conditions
  • [x] Basic console API

Phase 2: Expanded Language Support

This phase will broaden the range of supported JavaScript syntax and features.

  • [x] Error Handling: try/catch/finally blocks and throw.
  • [x] Objects: Literals, property access (dot and bracket notation), methods.
  • [x] Arrays: Literals, indexing, and core methods (.push, .pop, .length, etc.).
  • [x] Operators: Full suite of arithmetic, logical, and comparison operators.
  • [x] Control Flow: tenary operators, for loops, while loops, switch.

Phase 3: Interoperability & Standard Library

This phase will focus on building out the standard library and enabling modular code.

  • [ ] JS Standard Library: Implementation of common built-in objects and functions (Math, Date, String.prototype.*, Array.prototype.*).
  • [x] Asynchronous Operations: A C++ implementation of the JavaScript event loop, Promise, and async/await.
  • [ ] Module System: Support for import and export to transpile multi-file projects.

Phase 4: Optimization & Advanced Features

With a feature-complete transpiler, the focus will shift to performance and advanced capabilities.

  • [ ] Performance Benchmarking: Create a suite to compare transpiled C++ performance against V8 and other JS engines.
  • [ ] C++ Interoperability: Define a clear API for calling C++ functions from the transpiled JavaScript and vice-versa.

Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.