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

@digitaldefiance/eecp-crdt

v0.1.1

Published

Encrypted CRDT implementation using Yjs for EECP

Readme

@digitaldefiance/eecp-crdt

Encrypted conflict-free replicated data types for collaborative editing. Built on Yjs for deterministic conflict resolution with encrypted content payloads, operation encryption/decryption, and temporal garbage collection.

Features

  • Yjs-based text CRDT with encrypted operations
  • Insert, delete, and format operations with encryption
  • Deterministic conflict resolution for concurrent edits
  • Operation encryption with temporal keys
  • Temporal garbage collection for expired operations

Installation

npm install @digitaldefiance/eecp-crdt
# or
yarn add @digitaldefiance/eecp-crdt

Key Classes

EncryptedTextCRDT

The main CRDT implementation that wraps Yjs with encryption capabilities.

import { EncryptedTextCRDT } from '@digitaldefiance/eecp-crdt';

const crdt = new EncryptedTextCRDT();

// Insert text at position
crdt.insert(0, 'Hello, world!');

// Delete text
crdt.delete(7, 6); // Removes "world!"

// Get current text
const text = crdt.getText();

OperationEncryptor

Handles encryption and decryption of CRDT operations using temporal keys.

import { OperationEncryptor } from '@digitaldefiance/eecp-crdt';

const encryptor = new OperationEncryptor(temporalKeyManager);

// Encrypt an operation
const encryptedOp = await encryptor.encryptOperation(operation, timeWindow);

// Decrypt an operation
const decryptedOp = await encryptor.decryptOperation(encryptedOp);

CRDTSyncEngine

Manages synchronization of CRDT state between participants.

import { CRDTSyncEngine } from '@digitaldefiance/eecp-crdt';

const syncEngine = new CRDTSyncEngine(crdt);

// Apply remote operation
syncEngine.applyRemoteOperation(encryptedOperation);

// Get local operations to send
const localOps = syncEngine.getLocalOperations();

TemporalGarbageCollector

Automatically removes expired operations based on temporal key lifecycle.

import { TemporalGarbageCollector } from '@digitaldefiance/eecp-crdt';

const gc = new TemporalGarbageCollector(crdt, keyManager);

// Start automatic cleanup
gc.start();

// Manually trigger cleanup
await gc.collectExpiredOperations();

// Stop cleanup
gc.stop();

Usage Example

import {
  EncryptedTextCRDT,
  OperationEncryptor,
  CRDTSyncEngine,
} from '@digitaldefiance/eecp-crdt';
import { TemporalKeyManager } from '@digitaldefiance/eecp-crypto';

// Initialize components
const keyManager = new TemporalKeyManager(/* ... */);
const crdt = new EncryptedTextCRDT();
const encryptor = new OperationEncryptor(keyManager);
const syncEngine = new CRDTSyncEngine(crdt);

// Local edit
crdt.insert(0, 'Hello');

// Get and encrypt local operations
const localOps = syncEngine.getLocalOperations();
const encryptedOps = await Promise.all(
  localOps.map(op => encryptor.encryptOperation(op, currentTimeWindow))
);

// Send encryptedOps to other participants...

// Receive and apply remote operations
const remoteEncryptedOp = /* ... received from network ... */;
const decryptedOp = await encryptor.decryptOperation(remoteEncryptedOp);
syncEngine.applyRemoteOperation(decryptedOp);

// Get current text
console.log(crdt.getText());

Testing

The package includes 50+ tests covering:

  • CRDT operations (insert, delete, format)
  • Concurrent editing scenarios
  • Conflict resolution
  • Operation encryption/decryption
  • Garbage collection

Run tests:

npm test
# or
yarn test

Technology Stack

  • TypeScript - Type-safe implementation
  • Yjs - CRDT foundation for conflict resolution
  • CRDT - Conflict-free replicated data types
  • Encryption - Temporal key-based operation encryption

Related Packages

License

MIT