js_of_ocaml-build-runtime(1)

js_of_ocaml-build-runtime1

Build standalone runtime. used for separate compilation.

Usage

js_of_ocaml build-runtime [OPTION] … [JS_FILES] …

Overview

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.

Options (toplevel)

--nocmis, --no-cmis

Do not include cmis when compiling toplevel.

--toplevel

Compile 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.

Options (filesystem)

--extern-fs

Configure pseudo-filesystem to allow registering files from outside. (default)

--file=FILE

Register [FILE] to the pseudo filesystem.

-I DIR

Add [DIR] to the list of include directories.

--no-extern-fs

Configure pseudo-filesystem to NOT allow registering files from outside.

--ofs=FILE

Output the filesystem to [FILE].

Arguments

JS_FILES

Link JavaScript files [JS_FILES]. One can refer to path relative to Findlib packages with the syntax '+pkg_name/file.js'

Options

--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].

--enable=OPT

Enable optimization [OPT].

--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 (required)

Set output file name to [FILE].

--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.

Options

--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.

Exit status

js_of_ocaml build-runtime 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).

Releases

3 releases since Debian 11 (Bullseye); the text changed 2 times.

  1. 11
  2. 12
  3. 13

--Werror since Debian 12 (Bookworm).

--wrap-with-fun until Debian 11 (Bullseye).

Bugs

Bugs are tracked on github at https://github.com/ocsigen/js_of_ocaml/issues.

Authors

Jerome Vouillon, Hugo Heuzard.

License

Copyright (C) 2010-2020.

js_of_ocaml is free software, you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, with linking exception; either version 2.1 of the License, or (at your option) any later version.

From js-of-ocaml 5.9.1-1+b8 in Debian 13 (Trixie). Parsed by carta from the page's man source.