Real-world use example of ts2ocaml

Some OCaml/JavaScript enthusiasts may know that we spent almost two years working on a tool automatically generating OCaml bindings from TypeScript’s type definition files. To prepare for its release, we just published a repository to show an example use of it.

This example generates and actually uses a binding to a small JavaScript library called pretty-bytes, and it doesn’t only generate the binding, but also converts JSDoc comments to odoc ones.

We believe we can release ts2ocaml as early as this month, please look forward to the new announcement!


This is so good. I’d love to try running this against prisma’s generated client.

Your team is amazing for pursuing this.

Thanks this looks exciting!

The ts2ocaml-example example.opam depends on ts2ocaml-jsoo-stdlib which according to the opam file should be at . But there is no such repository…

Is this repository currently private? How can we build this example if the repo is private?

We are working on this project with a part-time student at our company, and I really don’t want to overwhelm them with the bug reports war too much. So, I’m going to keep it private until it’s ready to go public. That said, it will be available soon.


We just published the repository!