ronenness / adder Goto Github PK
View Code? Open in Web Editor NEWExecuting untrusted code with ease.
License: MIT License
Executing untrusted code with ease.
License: MIT License
Love this project, it looks like it could be perfect for my needs.
I read through the docs and I couldn't find an answer to the question I have.
Is it possible, and if so how would one go about doing so, for a user script to define a function and for that function to be executed externally in Node.js.
For example, could I have an adder script like so:
# Click handler
def onClick():
print("Clicked");
And then call that function from Node.js:
// Call event handler
program.execute("onClick");
Or something along those lines?
I couldn't find anything in the docs about this.
Thanks for the help!
Hey hey ^^
Very nice thing you've created here! One question though:
Thx for your feedback in advance and toodaloo ;)
I think this project is amazing and probably the best there is out there in terms of client-side sandboxes, but I think there are a couple of things holding it back.
One of the main problems I've noticed is the lack of shorthand list/dictionary initialization and access, which could make the creation and access much easier.
old_list = list(0,1,2)
old_dict = dict()
old_dict.set("a", 0)
old_dict.set("b", 1)
old_dict.set("c", 2)
print(old_list.at(1))
print(old_dict.get("b"))
# Would look much better like
new_list = [0,1,2]
new_dict = {"a":0, "b": 1, "c":2}
print(new_list[1])
print(new_dict["b"])
But the real dealbreaker for me was that there is no built-in way of creating classes/modules. Something like the python class
initializer would be very helpful to organize complex code.
Are there any plans for improving the syntax?
Thanks in advance
https://github.com/RonenNess/adder/blob/master/src/index.js#L14
if (typeof window !== undefined) {
window.AdderScript = adder;
};
should be typeof window !== "undefined"
this is causing the module to not work under node for me.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.