Malia
JavaScript and TypeScript runtime built in Rust. Same V8 engine as Node,
runs npm packages, ships its own package manager. HTTP is handled by hyper
on a dedicated thread pool, which is where the speed comes from -- your JS
still runs on V8, same as Node.
What's actually faster (independently verified):
- Startup: ~2.4x faster -- V8 heap snapshot, no bootstrap overhead.
Confirmed by independent testing (median 9.5ms vs 23ms).
- Worker spawn: ~2.5x faster -- isolate reuse, not fork. First message
arrives in ~3.6ms vs ~9ms on Node.
- Connection churn: on par -- hyper handles new-connection-per-request
as fast as Node's libuv.
What depends on hardware:
- HTTP keep-alive throughput -- our thread pool architecture benefits
from multiple cores. On a 2-core machine, Node's single-threaded event
loop can be faster for keep-alive workloads because there's no
cross-thread channel hop. On machines with 4+ cores, the thread pool
has room to spread. Benchmark on your target hardware.
- Memory -- with identical JS workloads the heap is the same (same V8).
RSS is slightly lower (~5-10%) due to a leaner process. The larger
savings come from using malia-specific features (KV store, off-heap
caching) instead of JS objects.
What's the same: CPU-bound JavaScript runs at the same speed -- it's
the same V8 engine. Malia doesn't make your JS faster, it makes the
surrounding infrastructure (startup, HTTP, workers) faster.
Native addons (N-API): .node files load via dlopen with the
full N-API function table (149 functions, Node-API v1 through v9).
Addons that use node-addon-api or raw N-API can create values,
access properties, call functions, handle errors, manage references,
create buffers, and run async work. Tested with a C addon exercising
the core surface. Some complex addons may still hit unimplemented
edges -- file an issue if you find one.
Things you don't need to install separately:
- Package manager (
npm install, npx, lockfiles, publish)
.env loading (auto at startup)
- Cron (
malia.cron("*/5 * * * *", fn))
- Concurrency control (
malia.parallel.map, mutex, semaphore)
- LRU cache with TTL (
malia.cache)
- Pub/sub (
malia.pubsub)
- Security headers, rate limiting, CORS (
jse.secure, jse.rateLimit, jse.cors)
- Security scanning (
malia scan, malia secrets, malia sbom)
- Deployment scaffolding (
malia deploy -> Dockerfile, systemd)
- CPU profiling (
malia profile)
- Database migrations (
malia migrate)
- Encrypted env files (
malia env-encrypt)
- SQLite, KV store, task queue, router, tracing, structured logging
- TypeScript (transpiled at load, cached on disk)
Architectural differences from Node:
- HTTP server runs on hyper (Rust) on its own thread pool, not on the JS event loop
- Workers get real OS threads with their own V8 isolates
- Permissions are deny-by-default (like Deno, unlike Node)
- Bounded channels (
chan()) with backpressure for async coordination
- Hot reload swaps handlers on a live server without restarting
The jse.* globals are aliases of malia.* for backward compatibility.
New code should use malia.*.
Guides for common tasks are in docs/HOWTO.md.
Installation
Prebuilt binaries for macOS, Linux, and Windows. No Rust or build
tools required.
macOS / Linux (one-liner)
curl -fsSL https://raw.githubusercontent.com/loreste/malia/main/scripts/install.sh | sh
Installs malia, jse, npm, npx, and node to ~/.malia/bin and adds
it to PATH. The npm, npx, and node commands are built into malia --
no separate Node.js installation required.
Debian / Ubuntu (.deb)
VERSION=$(curl -fsSL https://api.github.com/repos/loreste/malia/releases/latest | grep tag_name | cut -d'"' -f4 | tr -d v)
curl -fsSLO "https://github.com/loreste/malia/releases/latest/download/malia_${VERSION}_amd64.deb"
sudo dpkg -i "malia_${VERSION}_amd64.deb"
Fedora / RHEL / CentOS (.rpm)
VERSION=$(curl -fsSL https://api.github.com/repos/loreste/malia/releases/latest | grep tag_name | cut -d'"' -f4 | tr -d v)
curl -fsSLO "https://github.com/loreste/malia/releases/latest/download/malia-${VERSION}-1.x86_64.rpm"
sudo rpm -i "malia-${VERSION}-1.x86_64.rpm"
Packages install malia and jse to /usr/bin.
Windows
irm https://raw.githubusercontent.com/loreste/malia/main/scripts/install.ps1 | iex
Manual download
Archives and SHA256SUMS are attached to each
GitHub release; pushing a v*
tag builds them (.github/workflows/release.yml):
| Platform |
Archive |
| macOS arm64 |
malia-darwin-arm64.tar.gz |
| macOS x64 |
malia-darwin-x64.tar.gz |
| Linux x64 (glibc) |
malia-linux-x64-gnu.tar.gz |
| Linux x64 (musl) |
malia-linux-x64-musl.tar.gz |
| Linux arm64 |
malia-linux-arm64-gnu.tar.gz |
| Linux x64 (.deb) |
malia_<version>_amd64.deb |
| Linux x64 (.rpm) |
malia-<version>-1.x86_64.rpm |
| Linux arm64 (.deb) |
malia_<version>_arm64.deb |
| Linux arm64 (.rpm) |
malia-<version>-1.aarch64.rpm |
| Windows x64 |
malia-win32-x64.zip |
Linux glibc builds (archives, .deb, .rpm) run on glibc 2.28 or newer: RHEL/Alma/Rocky 8+,
Debian 10+, Ubuntu 20.04+. The musl build has no glibc requirement.
Releases: set the version in Cargo.toml, run scripts/version.py sync (npm packages),
then push the matching v<version> tag; the release refuses mismatched versions.
From source
cargo build --release
Produces target/release/malia and target/release/jse. build.rs
compiles src/ops.rs a second time to produce the startup snapshot, so the
first build compiles deno_core and its dependencies twice.
Usage
malia run examples/hello.ts # run a TypeScript file
malia run --allow-net examples/server.js # HTTP server
malia eval --allow-all 'console.log(6*7)' # evaluate a snippet as an ES module
malia # REPL (supports top-level await)
malia compile examples/hello.ts -o dist/hello # host-platform entry-source embedding
malia compile --wasm examples/hello.ts -o app.wasm
malia run app.wasm
Commands
| Command |
Description |
malia |
Run the entry point from the project config (see Configuration); opens the REPL if none is found |
malia run <file|dir> |
Run a .js, .mjs, .cjs, .ts, .mts, .cts, .tsx, .jsx, or .wasm file. --watch restarts on file changes; --wasm selects Wasm-related runtime options; JavaScript still runs in V8 |
malia eval <code> |
Evaluate a snippet as an ES module |
malia repl |
Start the REPL |
malia init [--toml] |
Create a project config file |
malia dev |
Run the entry point and restart on file changes |
malia start |
Run the entry point; forks cluster workers when cluster is configured |
malia test |
Run tests (node:test, TAP output) |
malia install / add / i |
Install packages from the npm registry (built-in or delegates to npm/yarn/pnpm) |
malia install -g <pkg> |
Install a package globally to ~/.malia/bin |
malia uninstall / rm |
Remove packages from node_modules and package.json |
malia list / ls |
List installed packages |
malia outdated |
Show packages with newer versions available |
malia audit |
Check installed packages for known vulnerabilities |
malia link [dir] |
Symlink a local package into node_modules or globally |
malia x <bin> |
Run a binary from node_modules/.bin, falling back to npx |
malia npm <args> |
Pass arguments through to npm |
malia config [show|get <key>] |
Print the resolved configuration |
malia compile <file> |
Embed source in the runtime binary. --wasm wraps source in a Wasm container (still needs malia to run — this is packaging, not JS-to-Wasm compilation) |
malia build |
Embed the configured entry source in the host runtime |
malia bench <file> |
Run a file and print its wall-clock time |
malia serve [dir] |
Instant static file server with directory listing, ETags, MIME types |
malia doctor |
Diagnose project health: deps, lockfile, config, security checks |
malia clean [--all] |
Remove node_modules, caches, temp files; --all clears global cache |
malia upgrade |
Check for and install the latest malia version |
malia env |
Show resolved environment variables from .env files and config |
malia scan [path] |
Scan source code for security vulnerabilities |
malia secrets [path] |
Find leaked API keys, tokens, and credentials |
malia permissions <file> |
Show what permissions a script needs before running it |
malia sbom |
Generate a CycloneDX SBOM for compliance audits |
malia deps [--tree] [--licenses] |
Dependency tree with sizes and license breakdown |
malia deploy [docker|compose|systemd|all] |
Generate production deployment files |
malia profile <file> |
CPU profiling with V8 inspector, top-functions report |
malia migrate [create|up|down|status] |
Database migration runner with SQLite-tracked state |
malia env-encrypt [encrypt|decrypt] |
AES-256-GCM encryption for .env files |
malia <script> |
Run a script defined in the config file or package.json |
Package management
Malia includes a built-in package manager. No separate npm or Node.js
installation is needed. When you install malia, npm and npx commands
are created automatically and route to the built-in installer.
# These all work out of the box, no Node.js required:
npm install express # install a package
npm install -g http-server # install globally
npm uninstall lodash # remove a package
npm init -y # create package.json
npm ls # list installed packages
npm run dev # run a script
npm test # run tests
npx cowsay hello # execute a package binary
# Or use the malia equivalents:
malia install express
malia install -g http-server
malia uninstall lodash
malia list
The built-in package manager supports the full npm workflow: lockfile
generation (package-lock.json v3), semver resolution, peer dependencies,
optional dependencies, bundled dependencies, download caching
(~/.malia/cache), and .npmrc auth for private registries. Lifecycle
scripts (postinstall) are disabled by default for security -- set
MALIA_SCRIPTS=1 to enable.
If an external package manager (npm, yarn, pnpm) is detected via lockfile,
malia delegates to it. Otherwise the built-in installer handles everything.
All 25 npm commands are supported: install, uninstall, update, list,
outdated, audit, init, link, pack, publish, prune, dedupe,
rebuild, cache, config, info, fund, whoami, prefix, root,
exec, run, test, start, version.
NPM_REGISTRY=https://registry.internal.com malia install # private registries
MALIA_INSTALL_SHIMS=1 # create npm/npx/node shims even if system versions exist
Node-compatible flags
-r/--require, --import, -e/--eval, -p/--print, -c/--check,
-i/--interactive, -v/--version, --no-warnings, --max-old-space-size,
--inspect[=host:port], --inspect-brk[=host:port],
and --enable-source-maps are accepted. Flags in NODE_OPTIONS are read as
well. process.version is v26.12.0, and when invoked through a node
symlink, --version prints the same.
Debugging
malia --inspect run app.js # start inspector on 127.0.0.1:9229
malia --inspect-brk run app.js # pause before first line
malia --inspect=0.0.0.0:9230 run app.js # custom host/port
Open chrome://inspect in Chrome or attach VS Code's debugger
("type": "node"