Skip to content

Commit

Permalink
Doc: environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
hhugo committed Jan 28, 2025
1 parent be5bf51 commit be8f842
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions manual/environment-variable.wiki
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
= Environment variables

To resolve an environment variable, js_of_ocaml will perform the
following steps, in the given order:

- If the variable was set at compile time with the [--setenv VAR] flag, return it.
- If running nodejs and the variable is set in the process environment ([process.env]), return it.
- If the variable is set in [globalThis.jsoo_env], return it. This can be used
to set an environment variable inside a web-browser.
- Return Not_found
1 change: 1 addition & 0 deletions manual/menu.wiki
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
==[[library|Library overview]]
==[[bindings|Binding a JS library]]
==[[rev-bindings|Export OCaml code to JavaScript]]
==[[environment-variable|Environment variable]]
==<<a_api subproject="js_of_ocaml" text="API"|index>>

=Wasm_of_ocaml - Reference Manual
Expand Down

0 comments on commit be8f842

Please sign in to comment.