@testx/eval
v1.0.0
Published
A very simple eval-in-context function.
Downloads
1,023
Readme
@testx/eval
This package exports a simple function, that allows you to eval code in context. The function has the signature evalInContext(context, codeToExecute).
Example
const assert = require("assert");
const evalInCtx = require("@testx/eval");
const context = { some: "value" };
const result = evalInCtx(context, "some");
assert.equal(result, "value");