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

idb-vfs

v1.0.0

Published

A versioned virtual file system for the browser built on IndexedDB and Dexie.

Readme

idb-vfs

A browser-only TypeScript library for a versioned virtual file system backed by IndexedDB and Dexie.

Features

  • File and folder CRUD with a hierarchical tree
  • Immutable file versions addressed by SHA-256 hash
  • Undo and redo through a session history pointer
  • Session-scoped filesystem instances
  • Standalone session teardown with terminateFS(...)
  • EventTarget-based mutation events
  • ESM, CJS, and type declaration output

Installation

npm install idb-vfs

Quick Start

import { createFS, terminateFS } from "idb-vfs";

const fs = await createFS({ sessionId: "demo-session" });

await fs.createFolder("/docs");
const file = await fs.createFile("/docs/hello.txt", "Hello world");

const latest = await fs.readFile(file.id);
console.log(latest);

await terminateFS({ sessionId: "demo-session" });

Public API

const fs = await createFS({ sessionId: "my-session" });

Available methods:

  • fs.createFile(path, content)
  • fs.deleteFile(fileId)
  • fs.readFile(fileId, versionHash?)
  • fs.updateFile(fileId, content)
  • fs.listFileVersions(fileId)
  • fs.createFolder(path)
  • fs.deleteFolder(folderId)
  • fs.rename(nodeId, nextName)
  • fs.move(nodeId, targetFolderId)
  • fs.listChildren(folderId)
  • fs.resolvePath(path)
  • fs.undo()
  • fs.redo()
  • fs.restoreVersion(fileId, versionHash)
  • fs.getHistory()
  • fs.on(event, handler)
  • fs.off(event, handler)

Standalone session lifecycle:

  • createFS({ sessionId })
  • terminateFS({ sessionId })

terminateFS(...) removes that session's nodes, history entries, and session metadata. It also deletes file versions that are no longer referenced by any remaining session data, and closes the underlying DB when the last session is terminated.

Events

Supported event names:

  • FILE_CREATED
  • FILE_UPDATED
  • FILE_DELETED
  • FILE_RENAMED
  • FILE_MOVED
  • FOLDER_CREATED
  • FOLDER_DELETED
  • FOLDER_MOVED

Example:

const unsubscribe = fs.on("FILE_CREATED", (event) => {
  console.log(event.detail.file.name);
});

unsubscribe();

Build Output

npm run build

The package emits:

  • dist/index.mjs
  • dist/index.js
  • dist/index.d.ts

Demo

The demo in demo/index.html is set up for static hosting:

  • it loads dexie from a pinned CDN import map
  • it loads a bundled demo/app.bundle.js instead of dist/

Rebuild the demo bundle with:

npm run build:demo

Notes

  • Runtime target: browser only
  • Storage backend: IndexedDB via Dexie
  • No server sync or multi-user collaboration