Creating native apps with just Javascript
justjs is a lightweight engine and toolchain designed to build native macOS applications using pure JavaScript on Apple Silicon (ARM64). It bundles a portable JavaScript runtime, an AppKit event loop driver, and a direct Mach-O executable generator.
- Direct Mach-O Generation: Generates standalone, signed ARM64 Mach-O executables.
- Native macOS GUI: Native AppKit windows without webview bloat or Electron overhead.
- Scaffolding & Project Builder: Simple
justjs createandjustjs buildworkflow. - Embeddable C++ Engine: Includes a C++ library (
libjustjs.dylib) and headers for custom integration.
- macOS (Apple Silicon / ARM64)
- Clang / Xcode Command Line Tools (
xcode-select --install) zlib(built-in macOS library)
git clone https://github.com/theyhaveice/justJavascript.git
cd justJavascript
make
make test
sudo make installTo install to a custom directory:
make install PREFIX=$HOME/.localjustjs create my-app
cd my-appThis creates:
manifest.json: Defines project metadata (name, etc.)main.js: Main application entry point
justjs build ../my-appconstapplication=newapp.Application({gui: true,});constwindow=newapplication.Window({title: app.manifest.name,width: 854,height: 480,});while(!window.closed){application.poll();}application.quit();constapplication=newapp.Application({gui: true,});constwindow=newapplication.Window({title: "Dashboard",width: 1024,height: 768,});while(!window.closed){application.poll();}application.quit();justjs script.jsOr piped via stdin:
printf'let answer = 40 + 2; console.log(answer);\n'| justjs /dev/stdin| Command | Description |
|---|---|
justjs create <projectName> | Create and scaffold a new project folder |
justjs build [projectDir] | Build a project directory into a native binary (default: .) |
justjs build <script.js> <app> | Build a single JavaScript file into a native binary |
justjs <script.js> | Execute a JavaScript file in the terminal |
When installed with make install, headers are located in <PREFIX>/include/justjs/:
justjs/app.h: High-level project builder and application generatorjustjs/javascript.h: Embeddable runtime, lexer, parser, and bytecode VMjustjs/macho.h: Direct Mach-O executable emitter
Link against -ljustjs:
c++ main.cpp -ljustjs -o my_appThis project is licensed under the MIT License - see the LICENSE file for details.