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

@xnetjs/history

v0.0.2

Published

History, audit & time travel for xNet (point-in-time reconstruction, undo/redo, diffs, blame, verification)

Downloads

31

Readme

@xnetjs/history

History, audit, and time travel for xNet -- point-in-time reconstruction, undo/redo, diffs, blame, and verification.

Installation

pnpm add @xnetjs/history

Features

  • HistoryEngine -- Central engine for history operations
  • Snapshot cache -- Cached point-in-time state snapshots
  • Audit index -- Indexed audit trail of all changes
  • Undo/redo -- Per-node undo manager with proper CRDT integration
  • Scrub cache -- Timeline scrubbing with interpolated states
  • Playback -- Play back changes over time
  • Diff engine -- Field-level diffs between versions
  • Blame engine -- Per-field attribution (who changed what)
  • Verification -- Cryptographic verification of change chains
  • Pruning -- Remove old history while preserving checkpoints
  • Schema timeline -- Track schema evolution over time
  • Document history -- Rich text (Yjs) document version tracking

Usage

import { HistoryEngine } from '@xnetjs/history'

const engine = new HistoryEngine(store)

// Get history entries for a node
const entries = engine.getHistory(nodeId)

// Reconstruct state at a point in time
const snapshot = engine.getSnapshotAt(nodeId, timestamp)

// Go to a specific version
engine.goTo(nodeId, version)

Undo/Redo

import { UndoManager } from '@xnetjs/history'

const undo = new UndoManager(store, nodeId)
undo.undo()
undo.redo()
undo.canUndo // boolean
undo.canRedo // boolean

Diffs

import { DiffEngine } from '@xnetjs/history'

const differ = new DiffEngine(store)
const diff = differ.diff(nodeId, version1, version2)
// => { fields: [{ field: 'title', old: 'Draft', new: 'Final' }] }

Blame

import { BlameEngine } from '@xnetjs/history'

const blame = new BlameEngine(store)
const attribution = blame.blame(nodeId)
// => { title: { author: 'did:key:...', timestamp: 1706..., version: 5 } }

Verification

import { VerificationEngine } from '@xnetjs/history'

const verifier = new VerificationEngine(store)
const result = verifier.verify(nodeId)
// => { valid: true, checkedVersions: 42 }

Architecture

flowchart TD
    Engine["HistoryEngine<br/><small>Central coordinator</small>"]

    subgraph Reconstruction["State Reconstruction"]
        Snapshot["SnapshotCache<br/><small>Point-in-time states</small>"]
        Scrub["ScrubCache<br/><small>Timeline scrubbing</small>"]
        Playback["PlaybackEngine<br/><small>Replay changes</small>"]
    end

    subgraph Analysis["Analysis"]
        Diff["DiffEngine<br/><small>Field-level diffs</small>"]
        Blame["BlameEngine<br/><small>Attribution</small>"]
        Audit["AuditIndex<br/><small>Indexed trail</small>"]
    end

    subgraph Integrity["Integrity"]
        Verify["VerificationEngine<br/><small>Chain verification</small>"]
        Prune["PruningEngine<br/><small>History cleanup</small>"]
    end

    subgraph Schema["Schema History"]
        Timeline["SchemaTimeline<br/><small>Schema evolution</small>"]
        SchemaScrub["SchemaScrubCache<br/><small>Schema version scrub</small>"]
    end

    subgraph Documents["Document History"]
        DocHistory["DocumentHistoryEngine<br/><small>Yjs version tracking</small>"]
    end

    Engine --> Reconstruction
    Engine --> Analysis
    Engine --> Integrity
    Engine --> Schema
    Engine --> Documents

    UndoMgr["UndoManager<br/><small>Per-node undo/redo</small>"] --> Engine

Modules

| Module | Description | | ----------------------- | -------------------------------- | | engine.ts | Central history engine | | snapshot-cache.ts | Point-in-time snapshot caching | | audit-index.ts | Indexed audit trail | | undo-manager.ts | Undo/redo operations | | scrub-cache.ts | Timeline scrubbing cache | | playback.ts | Change playback engine | | diff.ts | Field-level diff computation | | blame.ts | Per-field attribution | | verification.ts | Cryptographic chain verification | | pruning.ts | History pruning with checkpoints | | schema-timeline.ts | Schema evolution tracking | | schema-scrub-cache.ts | Schema version scrubbing | | document-history.ts | Yjs document version history |

Dependencies

  • @xnetjs/core, @xnetjs/data, @xnetjs/sync
  • yjs -- Document history operations

Testing

pnpm --filter @xnetjs/history test

3 test files covering history engine, document history, and edge cases.