---
name: "js_of_ocaml-link"
section: "1"
platform: "linux"
package: "js-of-ocaml"
version: "5.9.1-1+b8"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/js_of_ocaml-link"
---

# js\_of\_ocaml-link(1)

Js\_of\_ocaml linker

## NAME

js\_of\_ocaml-link - Js\_of\_ocaml linker

## SYNOPSIS

**js\_of\_ocaml link** \[*OPTION*\]… \[*JS\_FILES*\]…

## DESCRIPTION

js\_of\_ocaml-link is a JavaScript linker. It can concatenate multiple JavaScript files keeping sourcemap information.

## ARGUMENTS

- *JS\_FILES*

  Link JavaScript files \[*JS\_FILES*\].

## OPTIONS

- **-a**

  Build a library (.cma.js file) with the js files (.cmo.js files) given on the command line. Similar to ocamlc -a.

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

- **--linkall**

  Link all compilation units.

- **--no-sourcemap**, **--no-source-map**

  Don't generate source map. All other source map related flags will be ignored.

- **--noinline**, **--no-inline**

  Disable inlining.

- **-o** *FILE*

  Set output file name to \[*FILE*\].

- **--pretty**

  Pretty print the output.

- **-q**, **--quiet**

  suppress non-error messages.

- **--resolve-sourcemap-url**=*VAL* (absent=**false**)

  Resolve source map url.

- **--source-map-inline**

  Inline sourcemap in the generated JavaScript.

- **--source-map-root**=*VAL*

  root dir for source map.

- **--sourcemap**, **--source-map**

  Generate source map.

- **--toplevel**

  Compile a toplevel.

- **--Werror**

  turn all warnings into errors.

## COMMON 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 link** 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).

## BUGS

Bugs are tracked on github at *https://github.com/ocsigen/js\_of\_ocaml/issues*.

## SEE ALSO

[ocaml(1)](/ocaml/1.md)

[js\_of\_ocaml(1)](/js_of_ocaml/1.md)

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