aboutsummaryrefslogtreecommitdiffstats
path: root/tools/execute_js_code.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/execute_js_code.js')
-rw-r--r--tools/execute_js_code.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/execute_js_code.js b/tools/execute_js_code.js
new file mode 100644
index 0000000..4706e07
--- /dev/null
+++ b/tools/execute_js_code.js
@@ -0,0 +1,9 @@
+/**
+ * Runs the javascript code in node.js.
+ * @typedef {Object} Args
+ * @property {string} code - Javascript code to execute, such as `console.log("hello world")`
+ * @param {Args} args
+ */
+exports.run = function run({ code }) {
+ eval(code);
+}