# node:vm

<!-- Generated from reports/manifest.json by `node ./scripts/api-docs.ts`.
     Do not edit this file. Run `pnpm run docs` to rebuild it.
     Node v26.7.0, commit 975a25d, 2026-08-27T21:51:46.116Z. -->

# `node:vm`

## Import

```js
import vm from "nstdlib/vm";
```

> [!NOTE]
> The module imports. Its behavior has not been tested.

## Runtime support

| Where it runs | Status | Export coverage | Details |
| ------------- | ------ | --------------- | ------- |
| **nstd** | ⚠️ some support | – | 5/108 of Node's own eligible tests pass under nstd. |
| **Browser** | ❔ not tested | 100% of Node.js | It imports with the small process shim. 10/10 Node.js exports are available. No module-specific behavior test ran. |
| **Node.js (host)** | ❔ not tested | 100% of Node.js | 10/10 exports. |

## Exports (10 of 10)

Each cell shows what happens when code reads an export:

- ✅ Available through every import style. A named error also counts.
- ⚠️ Available through only some import styles.
- ❔ The export exists but has no value.
- ❌ The export does not exist.
- – This environment was not measured.

| Export | Node.js | nstdlib | browser |
| ------ | ------- | ------- | ------- |
| `Script` | <span title="Available" aria-label="Available">✅</span> | <span title="Available" aria-label="Available">✅</span> | <span title="Available" aria-label="Available">✅</span> |
| `compileFunction` | <span title="Available" aria-label="Available">✅</span> | <span title="Available" aria-label="Available">✅</span> | <span title="Available" aria-label="Available">✅</span> |
| `constants` | <span title="Available" aria-label="Available">✅</span> | <span title="Available" aria-label="Available">✅</span> | <span title="Available" aria-label="Available">✅</span> |
| `createContext` | <span title="Available" aria-label="Available">✅</span> | <span title="Available" aria-label="Available">✅</span> | <span title="Available" aria-label="Available">✅</span> |
| `createScript` | <span title="Available" aria-label="Available">✅</span> | <span title="Available" aria-label="Available">✅</span> | <span title="Available" aria-label="Available">✅</span> |
| `isContext` | <span title="Available" aria-label="Available">✅</span> | <span title="Available" aria-label="Available">✅</span> | <span title="Available" aria-label="Available">✅</span> |
| `measureMemory` | <span title="Available" aria-label="Available">✅</span> | <span title="Available" aria-label="Available">✅</span> | <span title="Available" aria-label="Available">✅</span> |
| `runInContext` | <span title="Available" aria-label="Available">✅</span> | <span title="Available" aria-label="Available">✅</span> | <span title="Available" aria-label="Available">✅</span> |
| `runInNewContext` | <span title="Available" aria-label="Available">✅</span> | <span title="Available" aria-label="Available">✅</span> | <span title="Available" aria-label="Available">✅</span> |
| `runInThisContext` | <span title="Available" aria-label="Available">✅</span> | <span title="Available" aria-label="Available">✅</span> | <span title="Available" aria-label="Available">✅</span> |
