1.0.0 • Published 9 years ago

swiss-army-eval v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
9 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

9 years ago

0.3.1

10 years ago

0.3.0

10 years ago

0.2.5

10 years ago

0.2.4

10 years ago

0.2.3

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago