Skip to content

Instantly share code, notes, and snippets.

@jonte
Created January 21, 2011 14:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonte/789774 to your computer and use it in GitHub Desktop.
Save jonte/789774 to your computer and use it in GitHub Desktop.
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