@wettstein/arcanevm
v0.1.1-dev
Published
A NodeJS-powered JS Script Engine and Context Manager.
Downloads
5
Readme
ArcaneVM (@wettstein/arcanevm)
A basic library for creating managing VM contexts and the Script Engine.
It is based on the node:vm internal module, providing abstractions and easier management of the VM and its context.
Features
- Create a vm context that is managed externally.
- Run JS code in a script engine.
Installation
npm install @wettstein/arcanevmUsage
Importing
import {
ScriptEngine,
ContextManager
} from "@wettstein/arcanevm"; // ESM Module Format
const arcanevm = require("@wettstein/arcanevm"); // CommonJS Module FormatCreating a ContextManager and passing it to the Script Engine.
// CommonJS
const arcanevm = require("@wettstein/arcanevm");
const contextManager = new arcanevm.ContextManager();
const scriptEngine = new arcanevm.ScriptEngine(contextManager);