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

@routier/file-system-plugin

v0.3.0

Published

Dexie plugin for routier

Readme

@routier/file-system-plugin

Routier storage backed by JSON files on disk. One directory per database, one file per collection.

import { DataStore } from "@routier/datastore";
import { FileSystemPlugin } from "@routier/file-system-plugin";

class AppStore extends DataStore {
  constructor() {
    super(new FileSystemPlugin("./data", "my-database"));
  }
}

Files land in ./data/my-database/<collection>.json.

Contracts

Durability

A save writes a temporary file and renames it over the target. rename is atomic on POSIX, so a reader or a crash sees the old file or the new one, never a torn write. The plugin also calls fsync on the temporary file before the rename, so the contents reach the disk before the name does.

The whole collection is rewritten on every save. Cost grows with collection size, not with the number of changed rows.

Process boundary — single process

A file-system database belongs to one process. After the first read the in-memory view is authoritative and the files are write-only. Rows another process writes are never observed, and two processes writing one database overwrite each other's files.

There is no lock file and no detection. If you need several processes, use a real database.

Concurrency within one process

Safe. One collection instance per resolved file path is shared process-wide, so overlapping saves mutate the same view and each rename writes a complete snapshot that is a superset of the last.

Schema migration

None. The plugin stores whole entities as JSON. A renamed or removed property does not rewrite what is on disk.

Corrupt files

A file that does not hold valid JSON fails the load with the parse error. The plugin does not overwrite it. An empty file is a valid empty collection.

Disposal

Call store.destroyAsync() to remove the database directory. The plugin refuses to remove a path that does not resolve to a direct child of the configured directory — an empty or ..-containing database name would otherwise target the parent and take every other database with it.

The plugin holds no long-lived handles: each read and write opens and closes its own.

Failure semantics

A failed save leaves the previous file in place. The plugin reports the underlying fs error: a full disk, a permissions failure, or a missing parent directory.

Supported versions

Node 18 or later. Uses node:fs only.

See also