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

@revisium/engine

v0.7.0

Published

Revisium version engine — core versioning logic for branches, revisions, tables, and rows

Readme

@revisium/engine

Git-like version control engine for structured data.

License Quality Gate Status Coverage npm

What is this?

A NestJS module library that provides Git-like versioning for structured data: branches, revisions, tables, rows, JSON Schema validation, diffs, formula plugins, and migrations.

Extracted from @revisium/core. No auth, no billing, no API controllers — pure versioning engine.

Usage

import { EngineModule, EngineApiService } from '@revisium/engine';

@Module({ imports: [EngineModule.forRoot()] })
export class AppModule {}

@Injectable()
export class MyService {
  constructor(private readonly engine: EngineApiService) {}

  async example() {
    await this.engine.createTable({ revisionId, tableId: 'products', schema });
    await this.engine.createRow({ revisionId, tableId, rowId, data });
    await this.engine.getRows({ revisionId, tableId, first: 100 });
    await this.engine.createRevision({ projectId, branchName, comment });
    await this.engine.revisionChanges({ revisionId });
    await this.engine.cleanOrphanedData();
  }
}

With file storage

Provide your own IStorageService implementation (S3, local filesystem, etc.):

import { EngineModule, IStorageService } from '@revisium/engine';

const myStorage: IStorageService = {
  isAvailable: true,
  canServeFiles: false,
  uploadFile: (file, path) => s3Client.upload(file, path),
  getPublicUrl: (key) => `https://cdn.example.com/${key}`,
};

@Module({ imports: [EngineModule.forRoot({ storage: myStorage })] })
export class AppModule {}

Without a storage provider, file operations throw "Storage is not configured".

File usage tracking

When file storage is configured, the engine tracks reference-counted file-byte totals per project. projectId is treated as an opaque string — the engine does not model organizations or project lifecycle. Consumers pass project identifiers when they want file-usage information:

const bytes = await engine.getProjectStorageBytes({ projectId: 'games' });
const orgBytes = await engine.getStorageBytesForProjects({
  projectIds: ['games', 'art', 'music'],
});

Reconciliation API for audits and legacy-data migration:

await engine.validateProjectFileBytes({ projectId: 'games' });
await engine.restoreProjectFileBytes({ projectId: 'games' });
await engine.backfillProjectFileBlobs({ projectId: 'games', dryRun: true });

Cleanup uses a tombstone + confirm pattern. cleanupOrphanedFileBlobs / cleanupProjectFileUsage tombstone rows (set deletedAt) and return orphanHashes — the content hashes whose last active row was just tombstoned. The engine never calls the storage provider; the consumer deletes the underlying objects and then confirms back so the tombstone rows are hard-deleted:

const { orphanHashes } = await engine.cleanupOrphanedFileBlobs();

const confirmed: string[] = [];
for (const hash of orphanHashes) {
  try {
    await myStorage.deleteFile(hash);
    confirmed.push(hash);
  } catch (error) {
    // leave tombstoned; getPendingStorageDeletions will surface it for retry
  }
}
if (confirmed.length > 0) {
  await engine.confirmStorageDeleted({ hashes: confirmed });
}

// Periodic reconcile pass for storage deletions that failed earlier:
const pending = await engine.getPendingStorageDeletions({ limit: 500 });

// Consumer-hard-deleted project:
await engine.cleanupProjectFileUsage({ projectId: 'games' });

// Forking a project: backfill the new projectId so it gets its own FileBlob rows
await engine.backfillProjectFileBlobs({ projectId: 'games-fork' });

See File Usage Tracking for the full data model, write rules, scenario table, and storage-side deletion workflow.

Data Model

Branch (projectId: string, opaque)
  └── Revision (head, draft, start)
        └── Table (schema: JSON Schema)
              └── Row (data: JSON, hash, meta)
                    └── FileBlob (via _FileBlobToRow M2M, unique per projectId+hash)

ProjectFileUsage (per-project byte counter, keyed by opaque projectId)

Documentation

Development

npm ci
docker compose -f docker/docker-compose.yml up -d
cp .env.example .env
npm run prisma:generate
npm run start:dev

| Script | Description | | ----------------- | ----------------------- | | npm run tsc | Type check | | npm run lint:ci | ESLint (0 warnings) | | npm test | Run tests (1100+ tests) | | npm run build | Production build |

Tech Stack

NestJS 11, TypeScript 5.9, PostgreSQL 17, Prisma 7, CQRS, Jest + SWC, ESLint 9, SonarQube

License

Apache-2.0