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

opfs-worker

v2.2.1

Published

Node.js-style filesystem API for OPFS — auto-creates a Worker for you, with optional async and SharedWorker modes

Readme

OPFS Worker

A full-featured filesystem layer for the browser, built on the Origin Private File System.

opfs-worker gives your app a familiar Node.js-style API for working with files and directories while handling the awkward browser parts for you: Worker setup, concurrent access, encodings, large-file streaming, change events, and cross-tab coordination.

Choose the runtime that fits your app: use a dedicated Worker for the fastest and widest-compatible path, run the async backend directly on the current thread, or share one filesystem process across every tab with SharedWorker.

No permission prompt or file picker is required. Files stay private to the current origin and live within the browser’s site storage, so clearing site data removes them.

Try the demo →

Features

File APIreadFile, writeFile, mkdir, stat, rename, copy, readDir; encodings, extension-based detection, string | URL paths. Docs

File descriptorsopen / read / write at an offset, plus ftruncate and fsync. Docs

Concurrent access — operations on the same path are serialized, so parallel reads and writes do not fail because another sync access handle is open.

Dedicated worker (default)createOPFS() sets up the worker for you. Fastest path, supports FDs, writes work in older Safari too. Docs

Async — same API on the main thread, no worker. No FDs. Writes need Safari 26+ (Safari 18 and older can only read). Docs

SharedWorker — one instance shared across tabs. Same limits as async (no FDs, Safari 26+ for writes). Docs

Bring your own worker — use it directly in a worker you already run, or load a prebuilt worker script. Docs

Large files — stream reads (readBlob) and writes (importStream / importFiles) without buffering everything. Docs · Upload · Download

Watch — change events with a Node-style watch(path, listener) (BroadcastChannel under the hood, including across tabs). Docs

Hashingstat() can include an etag or a SHA hash (SHA skipped above a size cap). Docs

Installation

npm install opfs-worker

Quick start

import { createOPFS } from 'opfs-worker';

// Starts a dedicated worker and returns a Node-like fs API
const fs = createOPFS({
  root: '/my-app',
  hashAlgorithm: 'SHA-256'
});

await fs.mkdir('/project');
await fs.writeFile('/project/hello.txt', 'Hello, OPFS!');
await fs.rename('/project/hello.txt', '/project/readme.txt');

const files = await fs.readDir('/project');
const text = await fs.readFile('/project/readme.txt'); // 'Hello, OPFS!'

// Tear down watches, close the backend, and terminate the worker
fs.dispose();

Choose a mode

| What you want | Use | | ---------------------------------------------------------------- | ---------------------------------------------------- | | Node-like fs via dedicated worker (default, works everywhere) | createOPFS() | | Node-like fs on the main thread (modern browsers / Safari 26+) | createOPFSAsync() from opfs-worker/async | | Node-like fs via SharedWorker (modern browsers / Safari 26+) | createOPFSShared() from opfs-worker/sharedworker | | OPFS inside a worker you already run (classes only) | OPFSSync / OPFSAsync from opfs-worker/pure |

Docs

Guides

| Guide | About | | ------------------------------------------------- | --------------------------------------------------------- | | Dedicated worker | How to use OPFS via a dedicated worker (the default path) | | Async | How to use OPFS on the main thread, without a worker | | SharedWorker | How to share one filesystem across all tabs | | Pure classes | How to drop OPFS into a worker you already run | | Streaming | How to read/write large files without buffering | | Uploading from disk | Pickers, paste, drag-and-drop into importFiles | | Downloading to disk | readBlob<a download> / showSaveFilePicker | | Watching | How to listen for file changes across tabs | | Hashing | How file hashes / etags work on stat and watch events |

Development

npm install
npm run build
npm run test
npm run lint
npm run type-check

Demo: npm run dev:demo / npm run build:demo / npm run preview.

Maintainer

Maintained with ❤️ by @kachurun