🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eval.function

Eval function in browser

1.0.1
latest
Version published
Weekly downloads
3
200%
Maintainers
1
Weekly downloads
 
Created

eval.function

Eval function in browser

JS

    const evalFunction = require('eval.function');

    const fn = await evalFunction(`
        function(name) { return 'hello ' + name }
    `);

    console.log(fn('user')) // hello user

HTML

<script src="https://unpkg.com/eval.function/eval.function.js"></script>
<script>
  (async () => {
    const evalFunction = window.EvalFunction;

    const fn = await evalFunction(`
        function(name) { return 'hello ' + name }
    `);

    console.log(fn('user')) // hello user
  })();
</script>

FAQs

Package last updated on 11 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts