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

compilets

v0.1.4

Published

Compile TypeScript to C++ Executables

Readme

Compilets

TypeScript to C++ compiler.

Giving a TypeScript project, it can translate the code to C++, and produce native executables and Node.js modules.

This project does not plan to support every TypeScript feature - doing so would make it downgrade to a JavaScript interpreter - it only translates code that can be effiently represented in C++. Code relying on JavaScript's dynamic natures, for example prototype and any, will be rejected.

Currently it is still very early days, and it fails to translate most existing TypeScript projects, but it is capable of turning some performance-critical code into native Node.js modules.

Docs

There is currently no documentation on which TypeScript syntax and features are supported.

CLI

Install:

npm install -g compilets

Help:

━━━ Compilets - 0.0.1-dev ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  $ compilets <command>

━━━ General commands ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  compilets build [--config #0] [--target #0] ...
    Build C++ project.

  compilets gen [--root #0] [--config #0] [--target #0]
    Generate a C++ project from TypeScript project.

  compilets gn-gen [--config #0] <--target #0>
    Run "gn gen" for the C++ project.

Example:

mkdir example
cd example
echo 'console.log("Hello World!")' > main.ts
compilets gen
compilets build
./cpp-project/out/Debug/example

Compatibility with tsconfig.json and package.json

When compiling a project, the tsconfig.json file under the root directory is used for initializing the TypeScript compiler. If such file is not present, following compilerOptions will be used:

{
  noEmit: true,
  noImplicitAny: true,
  strictNullChecks: true,
  allowImportingTsExtensions: true
}

In this case the .ts files under the root directory will be used for compilation, and the files are searched non-recursively.

Also, the compilerOptions.strictNullChecks field must be true when a tsconfig.json file is provided.

When a package.json file is found in the root directory, following rules are applied:

  • The name field is used as the project's name.
  • If the compilets.main field is a .ts file, a native module will be created.
  • If the compilets.bin field is an object with values of .ts files, executables will be created for each entry of the object.

An example package.json file:

{
  "name": "download",
  "compilets": {
    "main": "lib.ts",
    "bin": {
      "download": "cli.ts"
    }
  }
}

If there is no package.json file, the root directory must contain only one .ts file and it will be compiled into executable.

Developement

The documentations of Oilpan GC (cppgc) can be found at:

You can get familiar with TypeScript's compiler APIs with following articles:

Tools below will help developement of this project:

About GN, the build system used for building C++ code:

License

This project is published under GPLv3, the C++ code (/cpp/runtime) has a an extra linking exception.

In plain words, distributing the compiled executable files does not require you to open source, only including the source code of this project requires so.

I'll change the license to a permissive one if this project gets enough funding.

Contributor license agreement

By sending a pull request, you hereby grant to owners and users of this project a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute your contributions and such derivative works.

The owners of the this project will also be granted the right to relicense the contributed source code and its derivative works to a more permissive license.