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/erlang-polycall

v1.0.0

Published

Erlang NIF binding for the libpolycall 1.5.0 FFI.

Readme

erlang-polycall

Erlang NIF binding for libpolycall 1.5.0, published as @obinexusltd/erlang-polycall.

The binding has three deliberately small layers:

  1. erlang_polycall.erl provides Erlang result tuples and exceptions.
  2. erlang_polycall_nif.c marshals an iolist/binary configuration path.
  3. erlang_polycall.c calls polycall_ffi_run_config(path, 1).

No layer parses configuration or duplicates libpolycall runtime logic. The NIF call runs as dirty I/O work so a potentially blocking core call does not occupy a normal BEAM scheduler.

Erlang API

Status-oriented usage:

case erlang_polycall:run_config(<<"erlang-polycallrc">>) of
    {ok, 0} -> ok;
    {error, Status} -> {stop, Status}
end.

Exception-oriented usage:

try erlang_polycall:run_config_or_error("erlang-polycallrc") of
    ok -> continue
catch
    error:{polycall_error, Status} -> {stop, Status}
end.

run_config/0 and run_config_or_error/0 use erlang-polycallrc. Paths can be binaries or byte-oriented iodata; convert Unicode character data with unicode:characters_to_binary/1 before calling.

Install from npm

npm install @obinexusltd/erlang-polycall

This is a native source package. Its CommonJS entry point exposes absolute paths for Erlang and C build tooling:

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

console.log(polycall.erlangModule);
console.log(polycall.applicationSource);
console.log(polycall.nativeAdapter);
console.log(polycall.nifSource);
console.log(polycall.publicHeader);
console.log(polycall.ffiHeader);

The npm tarball includes Erlang/C sources, headers, examples, tests, scripts, Makefile, manifest, and runtime configuration. Platform-specific BEAM and NIF binaries are excluded.

Build and test

The native forwarding layer can be built and tested without Erlang/OTP:

npm run build
npm test
npm run verify

With Erlang/OTP installed, build and run the mock NIF smoke test:

npm run test:erlang

That test covers binary and list paths, {ok, 0}, {error, Status}, and the {polycall_error, Status} exception contract.

Build the production NIF

Point the linker at a libpolycall v1.5 library exporting polycall_ffi_run_config:

make nif POLYCALL_LDFLAGS="-L/path/to/libpolycall/lib -lpolycall"

The build detects the ERTS include directory through erl. It produces the BEAM application under ebin/ and the native library under priv/. If automatic detection is unavailable, pass ERL_INCLUDE=/path/to/erts/include.

Example invocation:

erl -noshell -pa ebin \
  -eval 'io:format("~p~n", [erlang_polycall:run_config()]), halt().'

The NIF follows the official Erlang NIF API and resolves its native library through the application's priv directory.

Publishing

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

Publishing is not performed automatically.

Author

Nnamdi Michael Okpala — [email protected]