VM
vm.isContext()
Tests whether an object was contextified. This does not certify trust, isolation or absence of side effects. Tested on Node.js 22.16.0. Example output (one line per entry): ["false true"].
Formal Syntax & Structure
nodejs syntaxnodejs
vm.isContext(object)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| object | object | Candidate object. |
Return Value
boolean
Context status.
Working Example
Example Snippetnodejs
import { isContext, createContext } from 'node:vm';console.log(isContext({}), isContext(createContext({})));