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

obix-binding-cpp

v0.5.0

Published

OBIX C++ Binding - Legacy system integration, embedded targets

Readme

obix-binding-cpp

Previous name: @obinexusltd/obix-binding-cpp — OBIX packages are named without an npm scope since decision D-102 (2026-09-29); the package, its version and its exports are unchanged.

TypeScript bindings for OBIX C++ runtime integration through the native ABI bridge.

Overview

obix-binding-cpp provides a modular bridge API for:

  • Creating and initializing a C++ binding configuration
  • Invoking ABI-backed polyglot functions with structured envelopes
  • Returning consistent typed invocation errors
  • Tracking heap allocation state across the binding lifecycle
  • Managing loaded shared libraries (.so / .dll) via a library registry
  • Resolving schema capabilities per SchemaMode (SWIG, RTTI, exception handling)

Installation

npm install obix-binding-cpp

Usage

import { createCppBinding } from 'obix-binding-cpp';

const binding = createCppBinding({
  ffiPath: '/path/to/libnativebridge.so',
  cppStandard: 'c++20',
  schemaMode: 'hybrid',
  memoryModel: 'manual',
  compiler: 'clang',
  swigEnabled: true,
  rttEnabled: true,
});

await binding.initialize();

// Invoke a polyglot function
const result = await binding.invoke('renderFrame', [width, height]);
console.log(result);

// Load a shared library into the registry
await binding.loadLibrary('/usr/lib/librenderer.so');
console.log(binding.getLibraryStats());

// Unload when done
await binding.unloadLibrary('/usr/lib/librenderer.so');

// Inspect heap usage
const heap = binding.getMemoryUsage();
console.log(heap.heapBytes, heap.peakHeapBytes);

await binding.destroy();

API

createCppBinding(config: CppBindingConfig): CppBindingBridge

Creates a binding bridge with lifecycle and invocation methods.

Lifecycle

| Method | Description | |--------|-------------| | initialize() | Validates ffiPath and schemaMode, marks binding ready | | invoke(fn, args) | Invokes a polyglot function through the native ABI | | destroy() | Tears down all sub-modules and marks binding uninitialized | | isInitialized() | Returns whether the binding is ready |

Memory

| Method | Description | |--------|-------------| | getMemoryUsage() | Returns CppHeapStats snapshot |

Library management

| Method | Description | |--------|-------------| | loadLibrary(path) | Registers a shared library path (no-op if not initialized) | | unloadLibrary(path) | Removes a shared library path | | getLibraryStats() | Returns LibraryRegistryStats with load/unload counts |

Sub-module accessors

| Accessor | Type | Description | |----------|------|-------------| | ffiTransport | FFITransportAPI | Raw envelope builder and dispatcher | | heapTracker | HeapTrackerAPI | C++ heap allocation tracker | | libraryRegistry | LibraryRegistryAPI | Loaded shared library registry | | schemaResolver | CppSchemaResolverAPI | Schema mode resolver and validator |

CppBindingConfig

| Field | Type | Default | Description | |-------|------|---------|-------------| | ffiPath | string | required | Path to the native bridge shared library | | schemaMode | 'monoglot' \| 'polyglot' \| 'hybrid' | required | Polyglot interop mode | | memoryModel | 'gc' \| 'manual' \| 'hybrid' | required | Memory management strategy | | cppStandard | CppStandard | undefined | C++ standard ('c++11'–'c++23') | | compiler | CppCompiler | undefined | Compiler hint ('gcc', 'clang', 'msvc') | | swigEnabled | boolean | undefined | Enable SWIG polyglot wrapping | | smartPointerPolicy | string | undefined | 'shared_ptr', 'unique_ptr', or 'raw' | | exceptionHandling | boolean | undefined | C++ exception handling enabled | | rttEnabled | boolean | undefined | Runtime type information enabled | | libRegistryMaxSize | number | unlimited | Maximum registered library entries |

Error model

Invocation errors are returned as typed objects (never thrown):

| Code | Meaning | |------|---------| | NOT_INITIALIZED | invoke called before initialize() | | MISSING_SYMBOL | No __obixAbiInvoker registered, or function identifier missing | | INVOCATION_FAILED | The ABI invoker threw during dispatch |

Each error includes the full InvocationEnvelope for debugging at ABI boundaries.

Schema capabilities by mode

| Capability | monoglot | hybrid | polyglot | |-----------|-----------|---------|-----------| | swigEnabled | No | Yes | Yes | | rttEnabled | No | Yes | Yes | | exceptionHandlingEnabled | Yes | Yes | Yes | | supportsMultiLanguage | No | Yes | Yes |

Development

npm run build
npm test

Documentation

In-depth guides live in docs/:

| # | Guide | |---|-------| | 01 | Overview | | 02 | Installation and Setup | | 03 | Binding Lifecycle and Configuration | | 04 | FFI Transport and the ABI Boundary | | 05 | Schema Modes | | 06 | Runtime Features | | 07 | Best Practices |


License

MIT

Installation

npm install obix-binding-cpp

API surface

  • obix-binding-cpp — 6 value exports: createCppBinding, createFFITransport, createHeapTracker, createLibraryRegistry, createSchemaResolver, normalizeFunctionIdentifier
  • Type declarations: ./dist/index.d.ts (and a declaration next to every JS entry point).

Architecture role

obix-binding-cpp is a binding: it connects OBIX to another syntax, paradigm or language.

The architecture of OBIX — the package families and which packages are public API — is indexed in the umbrella: docs/architecture.md.

Package relationships

  • Depends on (OBIX): no other OBIX package.
  • Used by (OBIX): no other OBIX package.

Testing

  • 5 test files ship in the npm package (__tests__/): the evidence of the package's contract, published so that its verification can be inspected — not runtime code (no entry point reaches them).
  • Standalone: 5 of 5 — they read nothing outside the package.
  • Run them with npm test (vitest run) in the OBIX monorepo, which provides the test tooling (Node's test runner, Vitest, TypeScript) and the harness.

Documentation

Repository

  • https://github.com/obinexus/obix-binding-cpp — [email protected]:obinexus/obix-binding-cpp.git
  • Issues: https://github.com/obinexus/obix-binding-cpp/issues
  • The repository is a clean export of the package from the OBIX monorepo. Its lineage — the sources it was recovered from and its earlier names — is PROVENANCE.json, shipped in this package; the repository's copy also records the monorepo commit it was exported from.

License

MIT — see LICENSE.