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

v1.0.0

Published

Idiomatic C++17 binding for the libpolycall 1.5.0 FFI.

Downloads

73

Readme

cpp-polycall

Idiomatic C++17 binding for libpolycall 1.5.0, published as @obinexusltd/cpp-polycall.

The adapter maps C++ strings and exceptions onto the single core FFI call polycall_ffi_run_config(config_path, 1). It contains no configuration parser, context implementation, or duplicated runtime logic.

C++ API

Choose explicit status handling:

#include <cpp_polycall/polycall.hpp>

const int status = polycall::run_config("cpp-polycallrc");
if (status != 0) {
    // Apply the application's error policy.
}

Or use the exception-oriented API:

try {
    polycall::run_config_or_throw("cpp-polycallrc");
} catch (const polycall::Error& error) {
    std::cerr << error.what() << '\n';
    return error.code();
}

run_config returns the core status unchanged. run_config_or_throw raises polycall::Error, whose code() and status() accessors expose that same value. Calling either function without an argument uses cpp-polycallrc.

The original src/polycall.hpp include path remains as a compatibility shim. New code should include <cpp_polycall/polycall.hpp>.

Install from npm

npm install @obinexusltd/cpp-polycall

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

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

console.log(polycall.source);
console.log(polycall.header);
console.log(polycall.compatibilityHeader);
console.log(polycall.ffiHeader);
console.log(polycall.cmakeLists);
console.log(polycall.config);

The npm tarball includes C++ sources, headers, CMake package files, examples, tests, scripts, Makefile, manifest, and runtime configuration. Generated native binaries are excluded.

Build and test

Using Make/npm:

npm run build
npm test
npm run verify

Using CMake and CTest:

cmake -S . -B cmake-build -DBUILD_TESTING=ON
cmake --build cmake-build
ctest --test-dir cmake-build --output-on-failure

The tests link the real C++ adapter against a mock libpolycall FFI and verify the path, run=1, status propagation, and exception contract.

CMake consumption

Install the package:

cmake --install cmake-build --prefix /desired/prefix

Then link both the adapter and libpolycall:

find_package(cpp_polycall 1 CONFIG REQUIRED)
find_package(polycall 1.5 CONFIG REQUIRED)

target_link_libraries(my_app PRIVATE
    cpp_polycall::cpp_polycall
    polycall::polycall)

The static C++ adapter intentionally leaves polycall_ffi_run_config for the libpolycall v1.5 library to resolve at final link time.

Run the example

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

The example accepts an optional configuration path and otherwise uses cpp-polycallrc.

Publishing

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

Publishing is not performed automatically.

Author

Nnamdi Michael Okpala — [email protected]