JS_OF_OCAML-LINK(1)

πŸ“¦
version 6.2.0 Β· 4 versions
, in ubuntu resolute

okay bestie, listen up β€” this is the Js_of_ocaml linker, straight out of the Js_of_ocaml Manual. It's the js_of_ocaml link command and she is iconic πŸ’…


✨ SYNOPSIS ✨

js_of_ocaml link [OPTION]… [JS_FILES]…

πŸ¦‹ DESCRIPTION πŸ¦‹

So like, js_of_ocaml-link is a JavaScript linker. That's it, that's the job. She takes a bunch of JavaScript files and concatenates them into one β€” and the whole time she's keeping your sourcemap information intact. No cap. 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • JS_FILES β€” the JavaScript files you want to link together. Just pass them, bestie. That's literally the assignment. πŸ’–

πŸ‘‘ OPTIONS πŸ‘‘

  • -a β€” build a library (a .cma.js file) out of the js files (the .cmo.js files) you dropped on the command line. It's giving ocamlc -a, fr fr. 🧚
  • --custom-header=VAL β€” give your generated JavaScript file a custom header. Lowkey the whole point is making your script executable with #!/usr/bin/env node πŸ‘€
  • --debug=SECTION β€” enable debug for SECTION. Turn it on, turn it up. πŸ”₯
  • --debuginfo, --debug-info β€” output debug information. Two names, one vibe.
  • --disable=OPT β€” disable the optimization OPT. Not today, optimization. πŸ’€
  • --empty-sourcemap, --empty-source-map β€” always generate empty source maps. Always. Periodt.
  • --enable=OPT β€” enable the optimization OPT. Yes queen, optimize. ✨
  • --linkall β€” link all compilation units. Every single one. She's thorough.
  • --no-sourcemap, --no-source-map β€” don't generate a source map at all. And heads up bestie β€” all other source map related flags will be ignored. Like, completely. πŸ™ˆ
  • --noinline, --no-inline β€” disable inlining. Leave the functions where you found them. πŸŽ€
  • -o FILE β€” set the output file name to FILE. Name your baby. 🍼
  • --pretty β€” pretty print the output. Because your code deserves to look good. πŸ’…
  • -q, --quiet β€” suppress non-error messages. Shhh. Only the real problems get to speak. 🀫
  • --resolve-sourcemap-url=VAL (absent=false) β€” resolve the source map url. Note the default, bestie: absent=false.
  • --source-map-inline β€” inline the sourcemap directly into the generated JavaScript. All up in there. 🫢
  • --source-map-root=VAL β€” the root dir for the source map. 🌸
  • --sourcemap, --source-map β€” generate a source map. Yes. Do it. ⭐
  • --toplevel β€” compile a toplevel. Main character behavior tbh. πŸ‘‘
  • -w WARN β€” enable or disable the warnings specified by the argument WARN. You're in charge of the warning situation. 🌈
  • --Werror β€” turn all warnings into errors. Every little warning? Now a whole error. Dramatic but valid. πŸ’€

🌟 COMMON OPTIONS 🌟

  • --help[=FMT] (default=auto) β€” show this help in the 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. (iykyk 🧚)
  • --version β€” show version information. The receipts, basically. πŸ’–

🚦 EXIT STATUS 🚦

js_of_ocaml link exits with:

  • 0 β€” on success. Slay. ✨
  • 123 β€” on indiscriminate errors reported on standard error. 😭
  • 124 β€” on command line parsing errors. You typed something weird bestie. πŸ’€
  • 125 β€” on unexpected internal errors (bugs). Not her fault, that's a bug. πŸ›

πŸ› BUGS πŸ›

Bugs are tracked on github at https://github.com/ocsigen/js_of_ocaml/issues. Go tell them, they want to know. πŸ™ˆ


πŸ‘€ SEE ALSO πŸ‘€


πŸ’œ AUTHORS πŸ’œ

Jerome Vouillon, Hugo Heuzard. Legends, honestly. 🫢


πŸ“œ 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. ✨


okay that's the whole page bestie, go link some JavaScript, you got this πŸ’…

signed, sealed, delivered β€” this was Js_of_ocaml 6.2.0, page JS_OF_OCAML-LINK(1), mwah πŸŽ€

πŸ“¦ where this page comes from