JavaScript interpreter in four lines of code!
I wrote a JavaScript interpreter in JavaScript itself (and yes, the NPM package is mine). With the interpreter, you can simply interpret JavaScript in four lines of code!
Interesting... does this run in a separated process (like spawn_child) or does it run with access to the upper level? What differentiates it from eval()
? Kewl project!
@RayhanADev Thanks! Basically, instead of using eval()
, it uses the NodeJS VM module. When you use the "interpret" function, it uses the script as the context. You can also use require inside of it, since require in the interpreter is the same as NodeJS's "require".
@Seven7Four4 niceeee. That's really cool dude, good luck!
@RayhanADev mod :0
@realTronsi yeah xD.
@RayhanADev it kinda feels like an accomplishment lol
[ redacted by moderators for advertising ]