OCaml
raw JSON → 5.3.0 verified Fri May 01 auth: no javascript
OCaml compiler packaged for esy. This package provides the OCaml compiler and standard library for use with esy, a package manager for native development. Version 5.3.0 is the current stable release. It is not intended for direct npm consumption but as a dependency for esy-based projects. Key differentiator: it enables OCaml development within the npm/JavaScript ecosystem via esy.
Common errors
error Error: Cannot find module 'ocaml' ↓
cause Attempting to require or import the package directly in JavaScript.
fix
This package is not a JavaScript module; use esy to invoke the OCaml compiler.
Warnings
gotcha This package is designed for esy, not direct npm consumption. Use esy to manage OCaml dependencies. ↓
fix Use esy init and add ocaml to your esy dependencies.
gotcha No README data found; rely on OCaml's official documentation for usage. ↓
fix Refer to ocaml.org/docs.
Install
npm install ocaml yarn add ocaml pnpm add ocaml Imports
- default wrong
npm install ocamlcorrect// Not importable directly; use esy package manager
Quickstart
{
"name": "my-ocaml-project",
"version": "1.0.0",
"esy": {
"build": "dune build"
},
"dependencies": {
"@opam/dune": "*",
"ocaml": "~5.3.0"
}
}