Open teone opened 8 years ago
You can create a command that executes a JavaScript code string using eval()
.
Example:
shell.setCommandHandler("eval", {
exec: function(cmd, args, callback) {
callback(eval(args.join(" ")));
}
});
// Shell
[1] $ eval "Hello, world!"
Hello, world!
Hey, I'd like to use this shell to create a tutorial on basic js command, is somehow possible to execute js code in the console?
Thanks