> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mirage.strukto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# QuickJS

> Run JavaScript scripts and pipe transforms in both Mirage SDKs.

What to install and a runnable Python example. The settings, how the workspace connects and the notes are on [QuickJS](https://docs.mirage.strukto.ai/home/setup/runtime/quickjs.md), shared by both SDKs.

## Install

Download `qjs-wasi.wasm` from a
[quickjs-ng release](https://github.com/quickjs-ng/quickjs/releases) and
point the runtime's `home`, or `MIRAGE_QUICKJS_HOME`, at its directory.

```bash theme={null}
pip install 'mirage-ai[quickjs]'
```

## Usage

Declare an `in_process` machine that runs QuickJS to run `node` on it once its engine is found:

```python theme={null}
from mirage import RAMVFS, MountMode, Workspace
from mirage.runtime.js import QuickJsRuntime

ws = Workspace(
    {"/data": RAMVFS()},
    mode=MountMode.EXEC,
    machines={"js": QuickJsRuntime(config={"home": "/path/to/quickjs"})},
)
await ws.shell("node -e 'console.log(1 + 1)'")
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.