Skip to main content

Crate ipfrs_nodejs

Crate ipfrs_nodejs 

Source
Expand description

Node.js bindings for IPFRS v0.2.0

This module provides JavaScript/TypeScript bindings for IPFRS using NAPI-RS. It exposes two independent surface areas:

  1. IpfrsClient – a self-contained, in-memory content-addressed store (mirrors the WASM IpfrsClient) that works without a running tokio runtime and is perfectly testable with cargo test.

  2. Node – a full IPFRS node that integrates block storage, semantic search, and TensorLogic reasoning. When built with NAPI-RS this struct is exposed to JavaScript; otherwise only the #[cfg(test)] surface is available.

Free functions:

  • compute_cid(data) – deterministic CIDv1 (SHA-256, raw codec, base32lower)
  • verify_cid(cid, data) – check a CID against raw bytes
  • version() – library version string

Structs§

ClientError
Internal error type for IpfrsClient operations.
IpfrsClient
Non-NAPI version used in unit tests and when building without the napi feature (e.g. cargo test --lib).

Functions§

cid_from_bytes
Compute a CIDv1 (base32-lower, SHA2-256, raw codec) string for data.
compute_cid
Non-NAPI version used in tests.
verify_cid
Non-NAPI version used in tests.
version
Non-NAPI version used in tests.