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.
- Host: GitHub
- URL: https://github.com/testxio/eval
- Owner: testxio
- Created: 2017-10-13T09:31:39.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-10-13T09:40:39.000Z (over 8 years ago)
- Last Synced: 2025-02-16T19:49:06.014Z (over 1 year ago)
- Language: JavaScript
- Size: 0 Bytes
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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");
```