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

@agntcy/slim-bindings-node

v0.1.11

Published

SLIM Node.js bindings using UniFFI

Readme

SLIM Node.js Bindings

Node.js bindings for SLIM using UniFFI. Bindings generated with uniffi-bindgen-node.

Installation

For released versions, install from npm (no Rust or build required):

npm install @agntcy/slim-bindings-node

This installs the main package and the matching platform-specific native addon for your OS/arch.

To build from source (e.g. for development or unsupported platforms), see Build from source below.

Prerequisites (build from source)

  • Rust toolchain
  • Node.js >= 18
  • Task

Usage

1. Generate Bindings (build from source)

task generate

2. Run P2P Examples

# Terminal 1: Start the server
task example:server

# Terminal 2: Start Alice (receiver)
task example:alice

# Terminal 3: Start Bob (sender) 
task example:bob

Available Commands

task generate         # Generate bindings
task clean            # Clean build artifacts
task example:server   # Run server
task example:alice    # Run Alice receiver
task example:bob      # Run Bob sender

Build Process

The bindings generation includes patching to fix compatibility issues between uniffi-bindgen-node (code generator) and uniffi-bindgen-react-native (runtime library):

  • Naming fixes: FfiConverterBytesFfiConverterArrayBuffer
  • Buffer wrapping: Proper RustBuffer allocation for byte arrays
  • Pointer conversions: BigInt → Number for FFI calls
  • Error handling: Enhanced error extraction from Rust

FFI Type Conversions

The generated bindings use bigint in TypeScript signatures for u64 types, but the underlying FFI layer returns JavaScript number types at runtime. Application code handles conversions at API boundaries:

// connectAsync returns a number at runtime, despite bigint type signature
const connId = await service.connectAsync(config);

// Convert to BigInt when passing to methods expecting bigint
await app.subscribeAsync(name, BigInt(connId));

// When using with methods that need number (for direct FFI calls)
app.setRoute(name, Number(connId));

Key conversions:

  • connectAsync returns number → convert to BigInt() for TypeScript bigint parameters
  • When calling FFI methods with u64 params → convert to Number() if passing bigint

This explicit conversion at API boundaries ensures type safety and makes FFI requirements visible.

Build from source

If you need to build from source (development or a platform not yet published):

  1. Ensure Rust and Task are installed.
  2. Run task generate (builds the Rust lib and generates Node bindings).
  3. Use the bindings from generated/ or run the examples with task example:server, etc.

Publishing (maintainers)

  • Dry run: From data-plane/bindings/node, run npm pack to produce a tarball and inspect contents (main package: no generated/; platform packages: task pack:platform TARGET=<target> then check dist/node-<platform>.tgz).
  • Version: Set in package.json; CI derives version from tag slim-bindings-v* via .github/scripts/get-binding-version.sh.
  • Secrets: NPM_TOKEN must be set in the repo for npm publish.

Resources