evalbuilder
v0.0.1
Published
easily build eval strings
Downloads
1
Readme
EvalBuilder
Eval string builder for javascript. To be used with libraries such as :
or any other usecase that requires you to input the code as a string.
Installation
npm install evalbuilder --save
Usage:
const evalbuilder = require("evalbuilder")
console.log(evalbuilder.max(1,2)); // 'max(1,2)'
console.log(evalbuilder.sum([1,2,3])); // 'max([1,2,3])'
console.log(evalbuilder.sort({id:1,str:'hey'},{id:2,str:'hi'})) // 'sort({"id":1,"str":"hey"},{"id":2,"str":"hi"})'
console.log(evalbuilder.anyfunctioname('hello!')) //anyfunctioname("hello")
Implementation
Utilises javascript es6 Proxy.