1.0.0 • Published 7 years ago

swiss-army-eval v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

swiss-army-eval

Evaluate code from different languages and return JS objects. More versatile and slightly gentler than JavaScript's eval.

Usage

# Command:                                            # Output:
compile('coffee', '2 + -1')                           # 1
compile("coffee", "(a, b) -> a + b")                  # function(a, b) {return a + b;}
compile("coffee", "(a, b) -> a + b")(2, -1)           # 1

compile('js', "5 - 3")                                # 2
compile("js", "function(a, b) {return a - b;}")       # function(a, b) {return a - b;}
compile("js", "function(a, b) {return a - b;}")(5, 3) # 2

compile("regex", "^[123]+$", "ig")                    # /^[123]+$/gi
compile("regex", "^[123]+$", "ig").exec('3')          # 3

About

1.0.0

7 years ago

0.3.1

9 years ago

0.3.0

9 years ago

0.2.5

9 years ago

0.2.4

9 years ago

0.2.3

9 years ago

0.2.2

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago