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

@peerbit/native-backbone

v0.2.10

Published

Native transaction backbone for Peerbit

Readme

@peerbit/native-backbone

Experimental native owner for Peerbit write transactions.

This package is intentionally internal-facing while the native write path is being fused. It owns the native lower-log graph, native log block store, and shared-log resident coordinate state in one Rust object so higher layers can move toward a single JS -> native -> compact facts transaction boundary.

Coordinate and document-fact WAL persistence

Native shared-log coordinates, document values, and document signer facts can be persisted through write-through or buffered WALs. Write-through flushes every append and is the strictest persistence mode. Buffered WALs batch bytes and flush on their pending-byte threshold, explicit flush, checkpoint, or close, which is the high-throughput mode for strict native document writes.

Use createBufferedNativeBackboneCoordinatePersistence(store) with OPFS, memory, or custom stores, and createBufferedNativeBackboneNodeCoordinatePersistence(dir) for the Node adapter. Persistence flush and replay are enabled by default; checkpoint compaction is not.

The built-in Node adapter supports explicit crash-safe checkpointing when its filesystem implementation provides atomic replacement. Opt in by setting compactMaxJournalBytes or compactMaxJournalRecords on NativeBackboneNodeCoordinatePersistence or createBufferedNativeBackboneNodeCoordinatePersistence:

const persistence = createBufferedNativeBackboneNodeCoordinatePersistence(
	programDirectory,
	{ compactMaxJournalBytes: 64 * 1024 * 1024 },
);

Crossing either configured threshold durably publishes one versioned, checksummed checkpoint for all three fact sets, switches between fixed A/B WAL generations, and records an atomic replay high-water mark before covered WAL data is retired. Checkpointing is serialized with flushes, so recovery chooses a fully published generation instead of combining partially replaced snapshots.

Memory and OPFS persistence, along with custom stores that do not implement the atomic replacement, removal, and durability capabilities, continue to reject these threshold options. They retain ordinary WAL flush and replay behavior. There is intentionally no automatic checkpoint threshold, including for the Node helpers.

The checkpoint bounds only the coordinate, document-value, and document-signer WALs. The entry-block WAL has a separate owner and remains out of scope, so this feature does not by itself bound every file in a program directory.

Existing directories using the legacy snapshots and WALs open without a manual migration. Their first checkpoint becomes forward-only once its staged generation and downgrade sentinel are durable. If publication is interrupted after that boundary, current recovery validates and promotes the staged generation; before the boundary, the complete legacy WAL remains authoritative. The sentinel makes a pre-checkpoint package fail closed rather than replay stale legacy files. Rolling back therefore requires restoring a pre-migration copy of the directory. This is an opt-in, forward-only internal persistence-format migration. It removes no public API and does not alter the peer-to-peer wire format; it does add observable Node checkpoint capabilities and downgrade behavior.

These fact WALs support clean stop/restart. They are not the recovery authority for a crash-atomic append across blocks, graph state, heads, coordinates, documents, and signer facts.

Local durability transaction primitives

The package also exposes the first, intentionally unwired building blocks for the proposed local crash-safe transaction protocol. This is an on-disk recovery format for one program directory; it is not a peer-to-peer wire protocol.

  • a versioned, checksummed native journal codec that distinguishes a structurally incomplete final frame from complete corruption;
  • transaction-private block staging and typed strict-barrier receipts;
  • immutable checkpoint generations with an A/B manifest switch; and
  • a Node directory lease backed by an OS-held LevelDB lock and a persistent fencing epoch.

These APIs do not change current append or open behavior. The Node filesystem adapter owns its official Rust codec and crash-released directory lease, and is the first supported strict physical backend on filesystems that support file and directory sync. Its first open creates a synced genesis only in an otherwise empty program directory; a nonempty legacy directory fails with NativeDurabilityMigrationRequiredError and is never adopted implicitly.

Phase one retains this separate durability-transaction journal and pins genesis as its scan base while newer A/B checkpoints prove staging coverage. Compaction of that journal is deliberately deferred until a later phase can switch its generation and scan base together; the coordinate/document-fact checkpointing described above does not alter it. Memory storage is a non-crash-safe reference adapter, and OPFS remains unsupported until its lifetime lease and worker-termination barriers have a dedicated conformance gate.