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

@fuguejs/fs

v0.3.0

Published

Local-filesystem adapter for the generic [`DocumentSource`](../document-source) capability. Reads files from a mounted directory for nodes that declare `requires: ["documents"]` and use `ctx.documents`.

Readme

@fuguejs/fs

Local-filesystem adapter for the generic DocumentSource capability. Reads files from a mounted directory for nodes that declare requires: ["documents"] and use ctx.documents.

This is the adapter with no external unknowns (no auth, no network): wire a DAG end-to-end against a local .xlsx for dev/test, then swap in @fuguejs/ms-graph by configuration with no node changes.

Usage

import { createFsAdapter } from "@fuguejs/fs";
import { localPathRef } from "@fuguejs/document-source"; // also re-exported from @fuguejs/fs

const docs = createFsAdapter({ rootDir: "/data/reports" }); // e.g. a PVC mount

// Register with the host:
const sharedInfra = { ...infra, capabilities: [docs] };

// In a node — path is relative to rootDir:
createFetchNode({
  id: "fetch-sheet",
  requires: ["documents"] as const,
  fetch: (input, ctx) => ctx.documents.getContent(localPathRef(`${input.period}.xlsx`)),
});

Security — confined to rootDir

Every localPath resolves relative to rootDir and is rejected (non-retriable) if it escapes (../ traversal, absolute paths) — the local equivalent of SharePoint's Sites.Selected. Confinement is lexical; for untrusted input over symlinked roots, mount the volume read-only and/or disallow symlink-following at the mount.

Config

createFsAdapter({
  rootDir: string,    // reads confined here; also stat'd at connect() to verify the mount
  fsImpl?: FsLike,    // inject node:fs/promises slice for tests
});

Error mapping

| fs code | FrameworkError | |---|---| | ENOENT (missing), EACCES/EPERM (denied), EISDIR | non-retriable node-crash | | traversal / foreign FileRef variant | non-retriable node-crash | | EIO/EBUSY/other | transient |

Deployment (OpenShift)

The pod filesystem is ephemeral — get the file there via an RWX PersistentVolume, an initContainer staging into an emptyDir, or (small static files) a ConfigMap/Secret volume. If the file lives in SharePoint, prefer @fuguejs/ms-graph and skip disk entirely. See ADR-0052 for the ranked options.

Exports

createFsAdapter, FsAdapterConfig, FsLike, mapFsError, resolveWithinRoot (pure helpers exported for testing), plus the re-exported port surface (localPathRef, fileRefKey, createFakeDocumentSource, types).