0
on success.
Js_of_ocaml compiler
js_of_ocaml [COMMAND]
…
Js_of_ocaml is a compiler from OCaml bytecode to Javascript. It makes it possible to run pure OCaml programs in JavaScript environments like web browsers and Node.js.
--export=VALFile containing the list of unit to export in a toplevel, with Dynlink or with --linkall. If absent, all units will be exported.
--nocmis, --no-cmisDo not include cmis when compiling toplevel.
--toplevelCompile a toplevel and embed necessary cmis (unless '--no-cmis' is provided). Exported compilation units can be configured with '--export'. Note you you'll also need to link against js_of_ocaml-toplevel.
|
Configure pseudo-filesystem to allow registering files from outside. (default) |
|---|---|
|
Register [FILE] to the pseudo filesystem. |
|
Add [DIR] to the list of include directories. |
|
Configure pseudo-filesystem to NOT allow registering files from outside. |
|
Output the filesystem to [FILE]. |
|
Js_of_ocaml pseudo filesystem utility |
|---|---|
|
Build standalone runtime. Used for separate compilation. |
|
Check runtime |
|
Js_of_ocaml compiler |
|
Js_of_ocaml linker |
|
Print standard runtime to stdout |
Link JavaScript files [JS_FILES]. One can refer to path relative to Findlib packages with the syntax '+pkg_name/file.js'
Compile the bytecode program [PROGRAM]. Use '-' to read from the standard input instead.
--custom-header=VAL
Provide a custom header for the generated JavaScript file, useful for making the script an executable file with #!/usr/bin/env node
--debug=SECTION
enable debug [SECTION].
--debuginfo, --debug-info
Output debug information.
--disable=OPT
Disable optimization [OPT].
--dynlink
Enable dynlink of bytecode files. Use this if you want to be able to use the Dynlink module. Note that you'll also need to link with 'js_of_ocaml-compiler.dynlink'.
--enable=OPT
Enable optimization [OPT].
--include-runtime
Include (partial) runtime when compiling cmo and cma files to JavaScript.
--keep-unit-names
Keep unit name
--linkall
Link all primitives and compilation units. Exported compilation units can be configured with '--export'.
--no-sourcemap, --no-source-map
Don't generate source map. All other source map related flags will be ignored.
--noinline, --no-inline
Disable inlining.
--noruntime, --no-runtime
Do not include the standard runtime.
-o FILE
Set output file name to [FILE].
--opt=NUM
Set optimization profile : [NUM].
--pretty
Pretty print the output.
-q, --quiet
suppress non-error messages.
--set=PARAM=VALUE
Set compiler options.
--setenv=PARAM=VALUE
Set environment variable statically.
--source-map-inline
Inline sourcemap in the generated JavaScript.
--source-map-no-source
Do not inline sources in source map.
--source-map-root=VAL
root dir for source map.
--sourcemap, --source-map
Generate source map.
--target-env={isomorphic,browser,nodejs} (absent=isomorphic)Runtime compile target.
--Werror
turn all warnings into errors.
--wrap-with-fun=VAL (absent=<Immediately Invoked Function Expression>)Wrap the generated JavaScript code inside a function that needs to be applied with the global object.
--help[=FMT] (default=auto)Show this help in format FMT. The value FMT must be one of auto, pager, groff or plain. With auto, the format is pager or plain whenever the TERM env var is dumb or undefined.
--version
Show version information.
js_of_ocaml exits with:
0
on success.
123
on indiscriminate errors reported on standard error.
124
on command line parsing errors.
125
on unexpected internal errors (bugs).
5 releases since Debian 8 (Jessie); the text changed 3 times.
--Werror since Debian 12 (Bookworm);
--custom-header since Debian 11 (Bullseye);
--debug since Debian 11 (Bullseye);
--debug-info since Debian 11 (Bullseye);
--debuginfo since Debian 11 (Bullseye);
--disable since Debian 11 (Bullseye);
--dynlink since Debian 11 (Bullseye);
--enable since Debian 11 (Bullseye);
--include-runtime since Debian 13 (Trixie);
--keep-unit-names since Debian 11 (Bullseye);
--linkall since Debian 11 (Bullseye);
--no-inline since Debian 11 (Bullseye);
--no-runtime since Debian 11 (Bullseye);
--no-source-map since Debian 11 (Bullseye);
--no-sourcemap since Debian 11 (Bullseye);
--noinline since Debian 11 (Bullseye);
--noruntime since Debian 11 (Bullseye);
--opt since Debian 11 (Bullseye);
--pretty since Debian 11 (Bullseye);
--quiet since Debian 11 (Bullseye);
--set since Debian 11 (Bullseye);
--setenv since Debian 11 (Bullseye);
--source-map since Debian 11 (Bullseye);
--source-map-inline since Debian 11 (Bullseye);
--source-map-no-source since Debian 11 (Bullseye);
--source-map-root since Debian 11 (Bullseye);
--sourcemap since Debian 11 (Bullseye);
--version since Debian 11 (Bullseye);
-o since Debian 11 (Bullseye);
-q since Debian 11 (Bullseye).
--help until Debian 9 (Stretch);
--runtime-only until Debian 12 (Bookworm);
--wrap-with-fun until Debian 11 (Bullseye);
-debuginfo until Debian 9 (Stretch);
-help until Debian 9 (Stretch);
-noinline until Debian 9 (Stretch);
-noruntime until Debian 9 (Stretch);
-pretty until Debian 9 (Stretch);
-toplevel until Debian 9 (Stretch).