bytecodealliance /StarlingMonkey

The StarlingMonkey JS runtime

★ 300⑂ 64👁 8⑃ 232● 137▤ 10
CApache-2.0Created 2023-10-04bytecodealliance.github.io/StarlingMonkey/
TA的项目
下载:starlingmonkey: v0.5.1starlingmonkey-v0.5.1 ↓0.5.12026-11-13
+0
日增长
300
stars
64
forks
8
watchers
232
prs
137
issues
10
releases

README

StarlingMonkey

  
    A SpiderMonkey-based JS runtime on WebAssembly
  

A Bytecode Alliance project

  
    
    
  

  
    Building
     | 
    Adopters
     | 
    Documentation
     | 
    Chat
  


StarlingMonkey is a [SpiderMonkey][spidermonkey] based JS runtime optimized for use in [WebAssembly
Components][wasm-component]. StarlingMonkey's core builtins target WASI 0.2.0 to support a Component
Model based event loop and standards-compliant implementations of key web builtins, including the
fetch API, WHATWG Streams, text encoding, and others. To support tailoring for specific use cases,
it's designed to be highly modular, and can be readily extended with custom builtins and host APIs.

StarlingMonkey is used in production for Fastly's JS Compute platform, and Fermyon's Spin JS SDK.
See the ADOPTERS file for more details.

 Documentation

For comprehensive documentation, visit our [Documentation Site][gh-pages].

 Quick Start

 Requirements

The runtime's build is managed by [cmake][cmake], which also takes care of downloading the build
dependencies. To properly manage the Rust toolchain, the build script expects
rustup to be installed in the system.

 Usage

With sufficiently new versions of cmake and rustup installed, the build process is as follows:

1. Clone the repo

console
git clone https://github.com/bytecodealliance/StarlingMonkey
cd StarlingMonkey


2. Run the configuration script

For a release configuration, run

console
cmake -S . -B cmake-build-release -DCMAKE_BUILD_TYPE=Release


For a debug configuration, run

console
cmake -S . -B cmake-build-debug -DCMAKE_BUILD_TYPE=Debug


3. Build the runtime

The build system provides two targets for the runtime: starling-raw.wasm and starling.wasm. The former is a raw WebAssembly core module that can be used to build a WebAssembly Component, while the latter is the final componentized runtime that can be used directly with a WebAssembly Component-aware runtime like wasmtime.

A key difference is that starling.wasm can only be used for runtime-evaluation of JavaScript code,
while starling-raw.wasm can be used to build a WebAssembly Component that is specialized for a specific
JavaScript application, and as a result has much faster startup times.

 Using StarlingMonkey with dynamically loaded JS code

The following command will build the starling.wasm runtime module in the cmake-build-release
directory:

console
 Use cmake-build-debug for the debug build
cmake --build cmake-build-release -t starling --parallel $(nproc)


The resulting runtime can be used to load and evaluate JS code dynamically:

console
wasmtime -S http cmake-build-release/starling.wasm -e "console.log('hello world')"
 or, to load a file:
wasmtime -S http --dir . starling.wasm index.js



 Creating a specialized runtime for your JS code

To create a specialized version of the runtime, first build a raw, unspecialized core wasm version of StarlingMonkey:

console
 Use cmake-build-debug for the debug build
cmake --build

Top issues

Latest release

starlingmonkey: v0.5.1 starlingmonkey-v0.5.1 2026-11-13
0.5.1 (2026-11-13)


 Bug Fixes

 Internalize CryptoKey metadata on creation (367) (3a94a50)
 Throw on createDigestAlgorithm returning null in RSA verification (364) (9aba354)
 Update normalization and copy order in crypto algorithms (366) (82eafe4)

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON