package js_of_ocaml

  1. Overview
  2. Docs
Compiler from OCaml bytecode to JavaScript

Install

dune-project
 Dependency

Authors

Maintainers

Sources

js_of_ocaml-6.5.0.tbz
sha256=a991ce25175a5a13240c8bf64354b8f35e0a8d7223b90bef01ba32bc6f929cf4
sha512=ce476986cb2c78990f29b1d7a01bb173a0d30ad0e0a80ba7bde9aa8365952ed01eda4935d92a323b982b0c1c897b20ef01eabe75fe80e4da858f73f6a2d25232

doc/api.html

API reference

The Js_of_ocaml distribution ships several opam packages, each providing one or more libraries. This page lists the public modules of every package; see the documentation home for the manual.

The top-level module of each library also states, in its own documentation, which opam package provides it.

js_of_ocaml — the base library

Provided by the js_of_ocaml opam package (library js_of_ocaml).

Core runtime and JavaScript values:

Browser APIs:

The same opam package also provides the js_of_ocaml.deriving library — the runtime used by the code that [@@deriving json] generates:

and the js_of_ocaml.devtools library, which displays OCaml values in the browser developer tools when the compiler is built with Introcaml:

js_of_ocaml-lwt — Lwt support

Provided by the js_of_ocaml-lwt opam package (library js_of_ocaml-lwt).

  • Js_of_ocaml_lwt.Lwt_js — sleeping and yielding
  • Js_of_ocaml_lwt.Lwt_js_events — DOM events as Lwt threads
  • Js_of_ocaml_lwt.XmlHttpRequest — XMLHttpRequest with Lwt
  • Js_of_ocaml_lwt.Jsonp — JSONP requests
  • Js_of_ocaml_lwt.File — reading files with Lwt
  • Js_of_ocaml_lwt.Promise — bridge between Lwt threads and JS promises

js_of_ocaml-ppx_deriving_json — JSON derivation syntax

Provided by the js_of_ocaml-ppx_deriving_json opam package. This is the PPX that derives JSON serializers ([@@deriving json]); the generated code relies on the Deriving_Json runtime from the js_of_ocaml package above. See the manual for usage.

js_of_ocaml-tyxml — TyXML support

Provided by the js_of_ocaml-tyxml opam package (library js_of_ocaml-tyxml).

  • Js_of_ocaml_tyxml.Tyxml_js — build and manipulate DOM trees with TyXML
  • Js_of_ocaml_tyxml.Tyxml_cast — cast between TyXML and Dom nodes
  • Js_of_ocaml_tyxml.Tyxml_cast_sigs — signatures for the casts

Provided by the js_of_ocaml-toplevel opam package (library js_of_ocaml-toplevel).

  • Js_of_ocaml_toplevel.Direct — run an OCaml toplevel in the browser
  • Js_of_ocaml_toplevel.Wrapped — toplevel evaluation returning errors and warnings as first-class values
  • Js_of_ocaml_toplevel.Wrapped_intf — result, error and warning types shared with the Web Worker driver