Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Running javascript from Erlang using erlang_js and SpiderMonkey
-module(js_test).
-export([run/0]).
run() ->
erlang_js:start(),
{ok, Port} = js_driver:new(),
ok = js:define(Port, <<"function helloworld(name){return 'Hello, ' + name}">>),
js:call(Port, <<"helloworld">>, [<<"Generic Game Server">>]).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment