https://github.com/dflemstr/minieval
https://github.com/dflemstr/minieval
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/dflemstr/minieval
- Owner: dflemstr
- Created: 2016-07-26T20:06:08.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-07-26T21:54:42.000Z (almost 10 years ago)
- Last Synced: 2025-10-20T08:44:37.681Z (8 months ago)
- Language: JavaScript
- Size: 150 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# minieval
Provides a Node module that supports static evaluation of strings.
The module has also been patched to support `@` as a special identifier.
## Example
```javascript
var minieval = require('minieval')
minieval.evaluate('a + 2', {a: 3}) // → 5
minieval.evaluate('@ + 3', {'@': 6}) // → 9
minieval.createFunction('a + b + c', ['a', 'b'], {c: 3})(2, 3) // → 8
```