filemount
v1.0.0
Published
Express middleware for a browser-based file editor powered by Monaco Editor
Maintainers
Readme
filemount
Drop a Monaco-powered file editor into any Express app with one line.
Why
You need to edit files on a dev server without SSH, FTP, or switching tools. Mount this middleware, point it at specific files, and edit them in the browser.
Install
npm install filemountUsage
const express = require('express');
const filemount = require('filemount');
const app = express();
app.use(filemount({
route: '/editor',
files: {
'config.json': '/var/app/config.json',
'styles.css': '/var/app/public/styles.css'
}
}));
app.listen(3000);
// Editor at http://localhost:3000/editorOptions
| Option | Default | Description |
|--------|---------|-------------|
| route | '/editor' | URL path for the editor UI |
| files | {} | Map of display names to absolute file paths |
Only files in the files map can be read or written.
API routes are automatically namespaced under your route (e.g. /editor/api/files).
Features
- Monaco Editor with 70+ language support
- Auto-detects language from file extension
- Unsaved changes detection
- Ctrl/Cmd+S to save
- Self-contained (no CDN)
Non-Goals
This is not:
- A file manager or directory browser
- A CMS or production editor
- A VS Code replacement
It edits specific files you explicitly allow. That's it.
Security
This middleware reads and writes real files. It has no authentication.
Do not expose on public routes.
Intended for:
- Local development
- Internal tools behind VPN
- Routes protected by your own auth middleware
License
MIT
