Last active
December 7, 2021 12:48
-
-
Save lmuntaner/8b20c316e0500450af26fd18d5bd934b to your computer and use it in GitHub Desktop.
NodeJS Competitor: RunJS π
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import dukpy | |
import sys | |
set_timeout_function = 'function setTimeout() { return; };' | |
if __name__ == '__main__': | |
filename = sys.argv[1] | |
(name, extension) = filename.split('.') | |
with open(filename, 'rt') as f: | |
js_text = f.read() | |
# RUNTIME ENVIRONMENT | |
result = dukpy.evaljs(set_timeout_function + js_text) | |
# NO RUNTIME ENVIRONMENT | |
# result = dukpy.evaljs(js_text) | |
print(result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment