Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

justjs

Creating native apps with just Javascript

Table of Contents

About

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.

Features

  • 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 create and justjs build workflow.
  • Embeddable C++ Engine: Includes a C++ library (libjustjs.dylib) and headers for custom integration.

Installation

Prerequisites

  • macOS (Apple Silicon / ARM64)
  • Clang / Xcode Command Line Tools (xcode-select --install)
  • zlib (built-in macOS library)

Build and Install

git clone https://github.com/theyhaveice/justJavascript.git
cd justJavascript

make
make test
sudo make install

To install to a custom directory:

make install PREFIX=$HOME/.local

Quick Start

1. Create a project

justjs create my-app
cd my-app

This creates:

  • manifest.json: Defines project metadata (name, etc.)
  • main.js: Main application entry point

2. Build the native app

justjs build .

3. Run

./my-app

Examples

Basic Window

const application = new app.Application({
  gui: true,
});

const window = new application.Window({
  title: app.manifest.name,
  width: 854,
  height: 480,
});

while (!window.closed) {
  application.poll();
}

application.quit();

Custom Dimensions and Title

const application = new app.Application({
  gui: true,
});

const window = new application.Window({
  title: "Dashboard",
  width: 1024,
  height: 768,
});

while (!window.closed) {
  application.poll();
}

application.quit();

Command Line Script Evaluation

justjs script.js

Or piped via stdin:

printf 'let answer = 40 + 2; console.log(answer);\n' | justjs /dev/stdin

CLI Reference

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

C++ API & Dynamic Library

When installed with make install, headers are located in <PREFIX>/include/justjs/:

  • justjs/app.h: High-level project builder and application generator
  • justjs/javascript.h: Embeddable runtime, lexer, parser, and bytecode VM
  • justjs/macho.h: Direct Mach-O executable emitter

Link against -ljustjs:

c++ main.cpp -ljustjs -o my_app

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Creating native apps with just Javascript

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages