https://github.com/slavahatnuke/eval.function
https://github.com/slavahatnuke/eval.function
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/slavahatnuke/eval.function
- Owner: slavahatnuke
- Created: 2019-02-11T10:06:47.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-02-11T10:22:02.000Z (over 6 years ago)
- Last Synced: 2025-01-28T23:31:17.723Z (4 months ago)
- Language: JavaScript
- Size: 1000 Bytes
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## eval.function
Eval function in browser
### JS
```javascript
const evalFunction = require('eval.function');const fn = await evalFunction(`
function(name) { return 'hello ' + name }
`);console.log(fn('user')) // hello user
```
### HTML```html
(async () => {
const evalFunction = window.EvalFunction;const fn = await evalFunction(`
function(name) { return 'hello ' + name }
`);console.log(fn('user')) // hello user
})();```