string-to-function

1.0.2 • Public • Published

This package was created for avoid to use "eval" in javascript when you need to convert function string to in-memory function.

Use example:

var stringToFunction = require('string-to-function');
var sum = stringToFunction('function sum(a, b){ return a+b; }');
var result = sum(1, 1);
// result === 2

Package Sidebar

Install

npm i string-to-function

Weekly Downloads

1

Version

1.0.2

License

ISC

Last publish

Collaborators

  • rcschettino