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

@glorychain/fs

v0.0.4

Published

Glory Chain file system connector

Readme

@glorychain/fs

File system connector for glorychain. Read, write, and watch chains stored as local JSON files.

npm install @glorychain/fs
# or
pnpm add @glorychain/fs

Use this connector when you want chains to live on disk — for local development, self-hosted deployments, or any scenario where files are your persistence layer.


Quick start

import { FsConnector } from "@glorychain/fs";

const connector = new FsConnector("./chains");

// Read a chain
const chain = await connector.read(chainId);

// Write (after appending a block via @glorychain/core)
await connector.write(updatedChain);

Each chain is a single JSON file at {dir}/{chainId}.json.


Watching for changes

The watch() method returns an async iterable that yields events whenever the chain file changes on disk. Use it to build real-time pipelines, audit daemons, or CI integrations.

for await (const event of connector.watch(chainId)) {
  if (event.type === "FILE_MODIFIED") {
    console.log(`Chain file changed: ${event.chainId}`);
  }
  if (event.type === "FILE_MISSING") {
    console.error("ALERT: chain file missing — possible deletion");
  }
  if (event.type === "UNEXPECTED_ERROR") {
    console.error("Watch error:", event.detail);
  }
}

The watcher runs integrity verification on every detected change. If the chain no longer verifies, it yields a threat event before your code processes the new state.


Threat detection

The file system connector watches not just for new blocks, but for anomalies — signs that a chain may have been tampered with outside the protocol.

| Event type | What it means | |------------|---------------| | FILE_MISSING | The chain file was deleted or moved | | FILE_MODIFIED | The chain file changed outside the protocol | | UNEXPECTED_ERROR | An internal error occurred during the watch cycle |

In a tamper-evident system, threat events are as important as normal events. A HASH_MISMATCH on a chain that previously verified is evidence of modification.


Configuration

const connector = new FsConnector(
  "./chains",     // directory where chain JSON files live
  {
    pollIntervalMs: 2000,   // poll interval for watch() — default: 2000ms
  }
);

File format

Each chain file is a single JSON document containing the full Chain object:

{
  "metadata": {
    "chainId": "3e7c9f2a-...",
    "createdAt": "2026-03-22T10:00:00.000Z",
    "protocolVersion": "0.0.1",
    "hashAlgorithm": "sha256",
    "signatureScheme": "ed25519",
    "migrationHistory": [],
    "knownForks": [],
    "transferHistory": []
  },
  "blocks": [
    {
      "blockNumber": 0,
      "chainId": "3e7c9f2a-...",
      "content": "Genesis: track all board decisions publicly",
      "publicKey": "MCowBQYDK2V...",
      "signature": "base64url...",
      "previousHash": null,
      "hash": "sha256hex...",
      "timestamp": "2026-03-22T10:00:00.000Z",
      "protocolVersion": "0.0.1",
      "creatorId": "[email protected]",
      "purpose": "governance",
      "identityType": "anonymous",
      "hashAlgorithm": "sha256",
      "signatureScheme": "ed25519",
      "contentSchema": null
    }
  ]
}

The full protocol spec for the chain and block schema is in @glorychain/core.


CLI shortcut

The glorychain CLI uses the file system connector by default:

glorychain create \
  --key $PRIVATE_KEY \
  --pubkey $PUBLIC_KEY \
  --content "My Chain" \
  --purpose "Track decisions"
glorychain verify --chain <chainId>

See apps/cli for full CLI documentation.