npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@obinexusltd/ocaml-polycall

v1.0.0

Published

OCaml source binding for libpolycall 1.5

Downloads

71

Readme

@obinexusltd/ocaml-polycall

OCaml source binding for libpolycall 1.5, published on npm as @obinexusltd/ocaml-polycall.

The binding is deliberately thin. An OCaml external function passes its string through a runtime C stub, and the native shim makes exactly one call to polycall_ffi_run_config(config_path, 1). Parsing, validation, and runtime behavior remain in libpolycall.

Install

npm install @obinexusltd/ocaml-polycall

This is a native source package. It publishes OCaml interfaces and sources, C sources and headers, Dune metadata, examples, tests, scripts, configuration, and build metadata. Compiler- and platform-specific binaries are excluded.

OCaml API

Return the libpolycall status directly:

let status =
  Polycall.run_config ~config_path:"ocaml-polycallrc" ()
in
if status <> 0 then exit status

Use an exception for startup paths where failure should unwind immediately:

try
  Polycall.run_config_or_error ~config_path:"ocaml-polycallrc" ()
with
| Polycall.Error status ->
    Printf.eprintf "libpolycall status: %d\n" status
  • Polycall.run_config returns the core status unchanged.
  • Polycall.run_config_or_error raises Polycall.Error status when nonzero.
  • Omitting config_path uses ocaml-polycallrc.

The public signature is in src/polycall.mli.

Build and test

Build the native adapter and run every locally available check:

npm run build
npm test

This machine currently has GCC and GNU Make but not ocamlc, Dune, or OPAM. Consequently, npm test runs the native mock contract test, thin-boundary audit, and npm package checks while clearly reporting the OCaml smoke test as skipped. When ocamlc is on PATH, that OCaml/C test runs automatically.

After installing OCaml, run the language-specific gates directly:

npm run build:ocaml
npm run test:ocaml

The native test proves that the configuration path is forwarded unchanged, validation mode is always 1, and statuses are preserved. The OCaml test then exercises default/explicit paths and Polycall.Error through the real runtime stub.

Dune integration

dune-project and src/dune define the public library ocaml-polycall. Build libpolycall first and make its library visible to the C linker, then run:

dune build

The Dune foreign stubs link with -lpolycall. Configure the compiler's library search path, or adapt c_library_flags, when libpolycall is outside a standard location.

A standalone example is available at examples/basic.ml.

JavaScript build-tool entry point

The CommonJS entry point indexes all published project directories:

const binding = require('@obinexusltd/ocaml-polycall');

console.log(binding.ocamlModule);
console.log(binding.runtimeStub);
console.log(binding.directories.src.relativeFiles);
console.log(binding.resolve('examples', 'basic.ml'));

Indexed relative directories are src, include, generated, dist, examples, tests, and scripts. resolve() rejects paths that escape the selected directory.

Publish

npm pack --dry-run
npm publish --access public

Publishing is never performed automatically.

Author and license

Nnamdi Michael Okpala ([email protected]). Licensed under MIT.