From c313b2e2e44985ac55055161a8aff186687c5cab Mon Sep 17 00:00:00 2001 From: Ian Hunter Date: Tue, 26 Mar 2024 09:41:54 +0000 Subject: [PATCH] Update README.md (#475) Signed-off-by: Ian Hunter --- src/js/README.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/js/README.md b/src/js/README.md index 23e6c4dc4..ccebac913 100644 --- a/src/js/README.md +++ b/src/js/README.md @@ -6,9 +6,7 @@ nav_order: 0 # Javascript -GNOLL is currently supported in Node as a console level application. -It is **not** supported in the browser yet. -We appreciate contributions that can change this. +GNOLL is currently supported in Node as a console level application and as a browser package. Emscripten does not allow file writing [ref](https://stackoverflow.com/a/54384808), at least via the same mechanism as the other languages, @@ -22,14 +20,19 @@ Output is currently only via stdout. sudo apt-get install emscripten nodejs ``` -### Build +### Run (Console) ```bash make javascript ``` -### Run - ```bash node build/js/a.out.js ``` + +### Run (Browser) + +Build with `make all jsweb` +Start a web server (e.g. `python3 -m http.server 8003 &> /dev/null &`) +Load index.html (http://localhost:8003/index.html in the previous example). +Provide notation in the textbox and press the "Roll" button. Output is printed to a separate div.