A very simple eval-in-context function.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.npmignore
README.md
index.js
package.json
test.js

README.md

@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");