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

https://github.com/slavahatnuke/eval.function


https://github.com/slavahatnuke/eval.function

Last synced: 2 months ago
JSON representation

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
})();

```