NeilFraser / JS-Interpreter

A sandboxed JavaScript interpreter in JavaScript.
Apache License 2.0
1.98k stars 353 forks source link

'modern' alternative to JS-Interpreter? #220

Closed TimNZ closed 2 years ago

TimNZ commented 2 years ago

Turns out it's quite a challenge to google for this.

Are there (newer) alternatives to JS-Interpreter that offer the same support for async as sync and other features, and out of the box ES6+ keywords/statements e.g. let, const?
Without having to use Babel.

Not supporting ES6+ is not a show stopper, I'm just looking at replicating Google App Scripts language support.

Nothing listed here is an alternative: https://en.wikipedia.org/wiki/List_of_ECMAScript_engines

Did read this: https://github.com/NeilFraser/JS-Interpreter/issues/186

CodeCity doesn't look active.

brownstein commented 2 years ago

I've actually had a pretty good experience using Babel to pre-process code and a source-map aware wrapper around this library to run and display it. Not perfect (babel generates a lot of code for async functions, which must be crunched by the interpreter), but it works.

See if there's anything you can borrow from https://github.com/brownstein/open-sourceror/tree/master/src/script-runner to meet your needs.

TimNZ commented 2 years ago

@brownstein thanks. Plenty to play with.