Js2Py
Js2Py copied to clipboard
Is there a plan to support arrow functions?
Currently, I can only use execjs to run my JavaScript methods because they heavily rely on arrow functions. The error message from js2py states: 'JsException: SyntaxError: Line 524: ArrowFunction is not supported by ECMA 5.1.'
@lanyuer You might find PythonMonkey useful! It supports modern JavaScript syntax and WebAssembly!
$ pip install pythonmonkey
import pythonmonkey as pm
my_js_func = pm.eval(' (x) => x*x ')
print( my_js_func(5) ) # prints 25.0
@wiwichips PythonMonkey works like a charm! You save my life!