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

@cogineai/mafs-node

v0.1.0-alpha.0

Published

A Unified Virtual Filesystem For AI Agents

Readme

@cogineai/mafs-node

npm version License

Node.js bundle for MAFS — A Unified Virtual File System for AI Agents.

This is the package most server-side and CLI consumers want. It re-exports everything from @cogineai/mafs-core and layers on Node-specific pieces:

  • Disk-backed resources: DiskResource, FUSE mounts via MafsFS, native nativeExec shell helpers.
  • Cloud storage with native SDKs: S3Resource, R2Resource, GCSResource, OCIResource, SupabaseResource.
  • Database resources: PostgresResource (with node-postgres driver), MongoDBResource.
  • HTTP-only resources (re-exported, identical to browser): Slack, Discord, Linear, Trello, Langfuse, GitHub, GitHub CI, GDocs/GSheets/GSlides/GDrive, Dropbox, Box, Gmail, Email (IMAP/SMTP).
  • Redis-backed cache: RedisFileCacheStore, RedisIndexCacheStore, RedisStore.
  • Local audio: LOCAL_AUDIO_COMMANDS powered by an optional sherpa-onnx-node peer.

Install

npm install @cogineai/mafs-node

Optional peers — only required if you use the matching feature:

| Peer | Used by | | ---------------------- | -------------------------------------------------- | | @zkochan/fuse-native | FUSE mounts (MafsFS, fuseMount, FuseManager) | | sherpa-onnx-node | Local audio transcription (localAudioTranscribe) |

The Workspace itself works fine without these peers; importing the corresponding modules without the peer installed surfaces a clear loadOptionalPeer error at first use.

Requires Node.js ≥ 20. macOS or Linux for FUSE; Windows is supported for the rest.

Quick start — S3 + RAM, with cache

import { MountMode, RAMResource, S3Resource, Workspace } from '@cogineai/mafs-node'

const ws = new Workspace(
  {
    '/data': new RAMResource(),
    '/s3': new S3Resource({
      bucket: 'logs',
      region: 'us-west-2',
      credentials: { accessKeyId: '…', secretAccessKey: '…' },
    }),
  },
  { mode: MountMode.WRITE },
)

// First call streams from S3 and populates the file cache.
await ws.execute('cp /s3/2026/05/22/error.log /data/error.log')

// Subsequent reads of the same key serve from the cache.
const lines = await ws.execute('grep "504 Gateway" /s3/2026/05/22/error.log | wc -l')
console.log(lines.stdoutText)

await ws.close()

Quick start — FUSE-mount a workspace as a real filesystem

import { fuseMount, RAMResource, Workspace } from '@cogineai/mafs-node'

const ws = new Workspace({ '/': new RAMResource() })
await ws.fs.writeFile('/hello.txt', 'mounted via FUSE!\n')

const handle = await fuseMount(ws, '/tmp/my-mafs-mnt')
// `cat /tmp/my-mafs-mnt/hello.txt` from another shell now works.

// Later:
await handle.unmount()
await ws.close()

Quick start — Redis cache for shared workers

import {
  RedisFileCacheStore,
  RedisIndexCacheStore,
  S3Resource,
  Workspace,
} from '@cogineai/mafs-node'

const ws = new Workspace(
  { '/s3': new S3Resource({ bucket: 'my-bucket' }) },
  {
    cache: new RedisFileCacheStore({ url: 'redis://localhost:6379/0', limit: '8GB' }),
    index: new RedisIndexCacheStore({ url: 'redis://localhost:6379/0', ttl: 600 }),
  },
)

What's exported beyond mafs-core

The full list lives in packages/mafs/typescript/packages/node/src/index.ts. Highlights:

  • DiskResource, DiskStore, DISK_OPS
  • RedisResource, RedisStore, RedisAccessor, REDIS_OPS
  • RedisFileCacheStore, RedisIndexCacheStore
  • MafsFS, FuseManager, fuseMount, fuseMountBackground
  • nativeExec, nativeExecStream, NativeProcess
  • S3Resource, R2Resource, GCSResource, OCIResource, SupabaseResource
  • PostgresResource, PostgresStore
  • MongoDBResource, MongoDBStore
  • SSCholarPaperResource, SSCholarAuthorResource, VercelResource, PostHogResource
  • SlackResource, DiscordResource, TrelloResource, LinearResource, LangfuseResource, GitHubResource, GitHubCIResource
  • GDocsResource, GSheetsResource, GSlidesResource, GDriveResource, DropboxResource, BoxResource
  • GmailResource, EmailResource
  • patchNodeFs for transparently routing Node fs.* reads through a Workspace
  • LOCAL_AUDIO_COMMANDS (optional sherpa-onnx-node)

Every Workspace primitive (Workspace, MountMode, FileStat, …) is also re-exported from @cogineai/mafs-core.

Companion packages

License & attribution

Apache-2.0. MAFS is a fork of Mirage; see the project-level NOTICE for attribution and the relationship to upstream.