Mountx 允许你使用熟悉的 node:fs/promises 接口用 JavaScript 编写自定义文件系统,并通过 FUSE 或 NFSv3 将其挂载为真正的内核文件夹,机器上的任何程序都可以访问。

Stars

48

7 天增长

暂无数据

Fork 数

1

开放 Issue

2

开源协议

MIT

最近更新

2026-07-29

AI 仓库情报摘要
FR-AI / ANALYSIS

为什么值得关注

它避免了学习特设 API 的需要,使任何数据存储(内存、S3、数据库)都能作为一个真实文件夹暴露出来,让 ls、cat 和 VSCode 等工具直接使用。

适合谁使用

  • 构建自定义文件系统驱动的 Node.js 开发者
  • 需要将云存储或数据库挂载为本地文件夹的开发者
  • 希望外部工具能访问内存或虚拟文件系统的 AI/Agent 开发者
  • 尝试从 JavaScript 使用 FUSE/NFSv3 的系统集成人员

典型使用场景

  • 将内存存储挂载为真实文件夹用于临时数据
  • 将 S3 存储桶暴露为本地文件系统以便遗留工具使用
  • 将数据库包装为文件系统以简化访问
  • 基于现有存储提供自定义视图(如过滤或转换)而不修改底层存储

项目优势

  • 使用标准 node:fs/promises 接口,无需学习新 API
  • 内置内存、磁盘和 unstorage 三种驱动,覆盖常见需求
  • 支持 Linux 的 FUSE 和 macOS 的 NFSv3,无需 root 权限即可挂载
  • 进程内回环接口支持无需挂载即可测试

使用前须知

  • Alpha 软件:API 可能变更,尚未进行安全或正确性审计
  • 挂载后,驱动程序可被机器上的所有程序访问,可能带来安全隐患
  • 目前仅支持 Linux (FUSE) 和 macOS (NFSv3),未提及 Windows 支持

README 快速开始

⛰️mountx

[!WARNING] Alpha. Mountx is early development: the API can still change, and it has not been through a security or correctness audit. A driver is reachable by every program on the machine once it is mounted.

Write a filesystem in JavaScript, mount it as a real kernel filesystem.

You can write a driver with the same methods as node:fs/promises (stat, readdir, open, mkdir, rename). Mountx takes your driver and turns it into a real folder on the machine, so ls, cat, AI Agents, VSCode and any other program can use it.

There is no special API to learn: node:fs/promises already is the interface, and the errors it throws already are the error format.

So anything that behaves a bit like a filesystem can get a real path: an in-memory store, a zip file, an S3 bucket, a database, or a plain folder served back out with your own rules on top.

import { mount } from "mountx/auto";
import { createLoopback } from "mountx";
import { createMemoryDriver } from "mountx/drivers/memory";

// A driver is any object with stat(), readdir(), open(), [mkdir()] and [rename()] methods.
// Mountx has built-in memory, fs and unstorage drivers
const driver = createMemoryDriver();

// Work with FS in-process without mounting
const fs = createLoopback(driver);
await fs.mkdir("/notes");
await fs.writeFile("/notes/hello.txt", "hi!");
new TextDecoder().decode(await fs.readFile("/notes/hello.txt")); // "hi"

// Mount the driver to the kernel with whatever this host can use
// FUSE on Linux (no root needed), NFSv3 on macOS
await using mounted = await mount(driver, "/mnt/point", {
  fuse: { attrTimeout: 10 }, // seconds the kernel may cache attributes
});

/**
# /mnt/point is a real folder now, so every program on the machine can use it:
$ cat /mnt/point/notes/hello.txt   =>   hi!
$ echo hey > /mnt/point/notes/other.txt
**/

if (mounted.transport === "fuse") {
  mounted.notifyInvalInode(2n); // storage changed behind mountx's back? drop the cache
}

await mounted.unmount(); // or let `await using` do it at the end of the block

Install

npx nypm i mountx

Or mount a demo filesystem right now, and watch every request the kernel makes:

npx mountx

Documentation

mountx.vercel.app

项目描述

⛰️ Write a filesystem in JavaScript, mount it as a real kernel filesystem.

相关仓库与替代方案

根据分类、Topic 和编程语言匹配的相似项目。

Jakubantalik
精选
Jakubantalik GitHub avatar

thinking-orbs

A React component library that renders six hand-tuned animated thought orb loading indicators on a plain 2D canvas, with two purpose-tuned sizes and automatic theme detection for AI and agent UIs.

AI 与机器学习AI 智能体
1,191
makecindy
精选
makecindy GitHub avatar

cindy

Cindy is an open-source AI agent that runs locally on your machine, integrates multiple AI harnesses and models, and provides memory, skills, and automation to perform real work in your projects and apps.

AI 与机器学习大语言模型
958
mereyabdenbekuly-ctrl
精选
mereyabdenbekuly-ctrl GitHub avatar

clodex-ide

Clodex is an open-source, local-first agentic IDE that combines persistent AI tasks, code, terminal, browser, Git, models, memory, and governed execution in one Electron workspace, currently in technical preview.

AI 与机器学习AI 智能体
859