An open API service indexing awesome lists of open source software.

https://github.com/testxio/eval

A very simple eval-in-context function.
https://github.com/testxio/eval

Last synced: about 1 month ago
JSON representation

A very simple eval-in-context function.

Awesome Lists containing this project

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

```javascript
const assert = require("assert");
const evalInCtx = require("@testx/eval");
const context = { some: "value" };
const result = evalInCtx(context, "some");
assert.equal(result, "value");
```