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

@wovin/storage-fs

v0.0.26

Published

Local filesystem storage backend for wovin using LMDB (Lightning Memory-Mapped Database).

Readme

@wovin/storage-fs

Local filesystem storage backend for wovin using LMDB (Lightning Memory-Mapped Database).

Persists wovin threads (applogs/blocks) to the local filesystem.

Features

  • Applog storage - Store and retrieve applogs by CID
  • Thread management - Track which applogs belong to which threads (many-to-many)
  • Block storage - Store raw bytes (for binary content referenced by applogs)
  • Deduplication - Applogs stored once, referenced by multiple threads
  • ACID transactions - Atomic writes via LMDB transactions

Installation

pnpm add @wovin/storage-fs

Usage

Basic Example

import { StorageFs } from '@wovin/storage-fs'
import type { Applog } from '@wovin/core/applog'

// Initialize storage
const storage = await StorageFs.init('./data/wovin-storage')

// Create applogs (CID must be pre-computed)
const applogs: Applog[] = [
  { cid: 'bafyrei...', en: 'entity-1', at: 'text', vl: 'Hello', ts: '2024-01-01T00:00:00Z', ag: 'alice', pv: null },
  { cid: 'bafyrei...', en: 'entity-1', at: 'text', vl: 'World', ts: '2024-01-01T00:00:01Z', ag: 'alice', pv: null },
]

// Store applogs in a thread
const stored = await storage.storeApplogs('my-thread', applogs)
console.log(`Stored ${stored} new applogs`)

// Retrieve applogs from thread
const retrieved = storage.getApplogs('my-thread')

// Get specific applog by CID
const applog = storage.getApplogByCid('bafyrei...')

// Check membership
storage.isApplogInThread('my-thread', 'bafyrei...')  // true

// Clean up
storage.close()

Multi-Thread Example

Applogs are deduplicated - the same applog can exist in multiple threads:

// Store in first thread
await storage.storeApplogs('thread-a', [applog1, applog2])

// Store same applogs in second thread (no duplication)
await storage.storeApplogs('thread-b', [applog1, applog2])

// Applog exists in both threads
storage.isApplogInThread('thread-a', applog1.cid)  // true
storage.isApplogInThread('thread-b', applog1.cid)  // true

// Delete thread-b (applogs remain, still in thread-a)
await storage.deleteThread('thread-b')
storage.hasApplog(applog1.cid)  // still true

Block Storage

For binary content referenced by applogs:

// Store a block
await storage.storeBlock('bafyrei...', new Uint8Array([1, 2, 3, 4]))

// Retrieve block
const bytes = storage.getBlock('bafyrei...')

// Check existence
storage.hasBlock('bafyrei...')

API

Initialization

StorageFs.init(path: string): Promise<StorageFs>

Initialize storage at the specified path.

Applog Methods

storeApplogs(threadId: string, applogs: Applog[]): Promise<number>

Store applogs in a thread. Returns count of newly stored applogs (excludes duplicates).

getApplogs(threadId: string): Applog[]

Get all applogs in a thread.

getApplogByCid(cid: CID | string): Applog | null

Get a specific applog by CID.

hasApplog(cid: CID | string): boolean

Check if an applog exists.

Block Methods

storeBlock(cid: CID | string, bytes: Uint8Array): Promise<void>

Store raw bytes by CID.

getBlock(cid: CID | string): Uint8Array | null

Get block bytes by CID.

hasBlock(cid: CID | string): boolean

Check if a block exists.

Thread Methods

listThreads(): string[]

List all thread IDs.

deleteThread(threadId: string): Promise<void>

Delete a thread (removes membership, keeps applogs).

getThreadApplogCount(threadId: string): number

Get count of applogs in a thread.

isApplogInThread(threadId: string, cid: CID | string): boolean

Check if an applog is in a thread.

Utilities

close(): void

Close the storage and release resources.

LMDB Structure

storage-fs/data.mdb
├── applogs        # cidString → Applog JSON
├── thread_index   # threadId → [cidString...] (dupSort)
└── blocks         # cidString → Uint8Array

Related Packages

License

Same as wovin monorepo