JavaScript that compiles
to native binaries.

Blue compiles your JavaScript to C++, then links it into a standalone native binary. Native GUI windows, filesystem, HTTP servers - no Electron, no Node.js at runtime.

curl -fsSL https://bluejs.dev/install.sh | bash
# Write JavaScript
echo 'window.open("<h1>Hello from Blue</h1>", "My App", 800, 500);' > hello.js

# Compile to a native binary
blue -compile hello.js -o hello

# Run it - a native GTK window opens, no Node.js required
./hello

This page is served by a Blue binary - 2.2 MiB total, HTML and HTTP in one self-contained executable.

~1 ms
startup time
Node.js: ~108 ms
3.8 MB
peak RSS
Node.js: 48.5 MB
60 KB
hello world binary
no runtime needed
0
runtime dependencies
AOT builds

How it works

AOT compilation

Your JavaScript entry file is compiled to C++ via a Babel-lowered AST, then linked into a native binary with no interpreter at runtime. Classes, closures, prototype inheritance, destructuring, template literals, and the full array/string/object method suite all work. Use AOT for native windows, filesystem, business logic, and performance-critical loops.

// src/main.js - compiled to C++
var notes = require("fs").readdirSync("./notes");
var file = Blue.Dialog.showOpenDialog("Open", "*.md", false);
Blue.Window.setTitle("Notes - " + notes.length + " files");
window.open("<h1>My App</h1>", "Notes", 900, 600);

QuickJS island

An optional embedded QuickJS engine provides full ES2020+, async/await, and npm packages via esbuild, all bundled into the same binary. The two contexts communicate over a lightweight bridge: Blue.callAot() and Blue.callIsland(). Use the island for HTTP servers, dynamic logic, and npm packages.

// src/island.js - runs in embedded QuickJS
const http = require("http");

const server = http.createServer((req, res) => {
  // call into AOT context and return the result
  var note = Blue.callAot("getNote", req.url.slice(1));
  res.writeHead(200, { "content-type": "text/html" });
  res.end(note);
});
server.listen(3000);

Native APIs

Blue.Window
  • setTitle(title)
  • setSize(w, h)
  • center()
  • minimize() / maximize()
  • setFrameless(bool)
  • close()
Blue.Dialog
  • showOpenDialog(title, patterns, multiple) - path
  • showSaveDialog(title, defaultName) - path
  • showMessageBox(title, msg, type, buttons) - index
Blue.Clipboard
  • readText() - string
  • writeText(text)
Blue.Process
  • exec(cmd) - { code, stdout, stderr }
May work in the island - test compatibility
  • Pure JavaScript utility packages
  • Frontend UI frameworks (for bundle generation)
  • Basic HTTP routing packages
  • async/await, ES2020+, full closures
  • Node built-ins: fs, path, os, http
Does not work
  • Native addons (.node files)
  • worker_threads, child_process
  • Packages that rely on Node.js internals
  • crypto.subtle, WebSockets - partial support only
  • eval / new Function(str) at runtime

The island runs embedded QuickJS, not Node.js. npm compatibility varies - pure JavaScript packages are most likely to work; anything depending on Node.js internals or native addons will not. Always test your specific packages before shipping. Run blue --print-c file.js to inspect generated C++ for AOT debugging.

Examples

Quick start
Scaffold a hybrid project with an AOT entry point, QuickJS island, and embedded HTML frontend.
blue -init myapp
cd myapp
blue -build myapp -o myapp
./myapp
hello-webview
Open a native GTK window in 15 lines - the smallest possible Blue app.
blue -compile hello.js -o hello
./hello
markdown-notes-demo
WebView with filesystem read/write via the blue:// bridge.
blue -build examples/markdown-notes-demo -o notes
./notes
http-server
Hybrid HTTP server using a QuickJS island and Blue.System.
blue -build examples/http-server -o http_demo
./http_demo
react-init-hybrid
React frontend bundled by esbuild and embedded in the binary.
blue -build examples/react-init-hybrid -o react_demo
./react_demo
full-api-demo
Every Blue.* API in one app - Window, Dialog, Clipboard, Process.
blue -build examples/full-api-demo -o api_demo
./api_demo

Browse all examples at github.com/bluejs-team/Bluejs.

Benchmarks vs Node.js

Blue Node.js v18
Startup time~1 ms~108 ms
Peak RSS (hello world)3.8 MB48.5 MB
Binary size (hello world)60 KBrequires 46 MB libnode.so
10M-iteration loop~63 ms~112 ms
HTTP server RSS (idle)6.5 MB50.0 MB
HTTP server threads (idle)210
HTTP server virtual memory14.3 MB610.4 MB
npm ecosystempartial (QuickJS island)full

Ubuntu Linux, Node.js v18.19.1. Startup and loop benchmarks use blue -compile (strict AOT). HTTP server uses hybrid mode with QuickJS island and libuv statically linked. The 610 MB Node.js virtual memory figure reflects V8 heap reservation and JIT buffers at startup, not physical RAM.

Installation

Linux - one-line installer

Downloads a prebuilt tarball and symlinks blue into ~/.local/bin. Checks for all required dependencies and tells you what to install.

curl -fsSL https://bluejs.dev/install.sh | bash

Debian / Ubuntu (.deb)

Install from the terminal with apt, not the Ubuntu App Center.

sudo apt install ./blue-linux-amd64.deb

Windows

Download the zip, extract it, then run the PowerShell installer. Installs to %LOCALAPPDATA%\Blue and adds blue to your PATH.

Expand-Archive blue-windows-x86_64.zip
cd blue-windows-x86_64
.\install.ps1

Requires a C++ compiler: winget install MinGW.MinGW or MSVC Build Tools. For native GUI windows, install the WebView2 SDK and set WEBVIEW2_SDK_PATH.

System dependencies (Linux)

Blue emits C++ and compiles it on your machine, so a C++ compiler is always required. Other dependencies are optional depending on what you build.

# Always required
sudo apt install build-essential pkg-config

# For native GUI windows (window.open, Blue.Window, Blue.Dialog)
sudo apt install libgtk-3-dev libwebkit2gtk-4.1-dev

# For HTTP servers and hybrid island builds
sudo apt install libuv1-dev nodejs

Source code

Blue is currently closed source. Documentation, examples, and issue tracking are available at github.com/bluejs-team/Bluejs. Join the community on Discord.

First app

# Open a native window
echo 'window.open("<h1>Hello from Blue</h1>", "Hello", 800, 500);' > hello.js
blue -compile hello.js -o hello && ./hello

# Scaffold a full hybrid project
blue -init myapp
blue -build myapp -o myapp && ./myapp