rafaels-dev / string-to-function

Package for convert string to function without use eval

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Package for convert string to function without use eval


Languages

Language:JavaScript 100.0%