A secure, modern static file explorer and manager for Node.js with a redesigned web UI, full-featured CLI, and comprehensive file management system.
npm install peek-explorer# Start server
peek start
# Start with custom directory
peek start --dir /path/to/files
# Start with token authentication
peek token generate
peek start --token <your-token>
# Interactive mode
peek cli
# Help
peek --helpThen open http://127.0.0.1:3000 in your browser.
- 8 Critical Vulnerabilities Fixed
- Path traversal prevention
- Token-based authentication
- CSRF protection on all mutations
- Rate limiting (300 req/min per IP)
- Binary-safe file uploads
- Request body size limits
- Security headers (CSP, X-Frame-Options)
- XSS and injection prevention
- Trash System - Move files to trash instead of permanent deletion
- File Recovery - Restore deleted files from trash with metadata
- Auto-Backups - Automatic backups before editing
- Batch Operations - Copy, move, delete multiple files at once
- Advanced Search - Find files by name, content, size, or modification time
- Duplicate Detection - Identify potential duplicate files
- File Checksums - SHA256 hashes for integrity verification
- Dark & Light Theme - Toggle between themes (persisted)
- Responsive Design - Works on desktop, tablet, mobile
- Grid & List Views - Switch between view modes
- Breadcrumb Navigation - Easy navigation through directories
- Inline Editor - Edit text files directly in the browser
- File Preview - Preview images and documents in modal
- Drag & Drop - Upload files by dragging and dropping
- Real-time Search - Filter and search files instantly
- Interactive Mode - Full CLI with start/stop/restart commands
- Token Generation - Generate secure auth tokens
- Configuration - Support for config files and environment variables
- Status Monitoring - Check server status and configuration
- Directory Management - Change directories on the fly
- Directory Statistics - Count files, folders, calculate sizes
- File Type Detection - Categorize files (image, video, document, code, etc.)
- Size Reports - Generate detailed size reports
- Modification Tracking - Track recently modified files
- Real-time Watcher - Monitor file system changes
- Change Logging - Log all file operations with timestamps
- Event Filtering - Query changes by type, name, or time range
- Sync Tracking - Track pending changes for sync operations
- Node.js >= 18.0.0
- npm >= 9.0.0
npm install peek-explorernpm install -g peek-explorer
peek startgit clone https://github.com/aydope/peek.git
cd peek
npm install
npm run devpeek start
# → http://127.0.0.1:3000peek token generate
# Output: Your token: a1b2c3d4e5f6...
peek start --token a1b2c3d4e5f6...peek start --readonly
# Users can view but cannot upload, edit, or deletepeek start --dir /home/user/documentspeek start --port 8080
# → http://127.0.0.1:8080peek start --open
# Browser opens automaticallypeek cli
# Available commands:
# start - Start the server
# stop - Stop the server
# restart - Restart the server
# status - Show server status
# port <num> - Change port
# dir <path> - Change directory
# token - Show/generate tokens
# readonly - Toggle read-only mode
# copy - Copy current URL
# help - Show help
# clear - Clear screen
# exit - Exit CLICreate peek.config.json:
{
"port": 3000,
"host": "127.0.0.1",
"directory": "./public",
"token": "your-secret-token",
"readonly": false,
"maxFileSize": 52428800,
"maxUploadBytes": 104857600,
"rateLimit": {
"windowMs": 60000,
"maxRequests": 300
}
}PEEK_PORT=3000
PEEK_HOST=127.0.0.1
PEEK_DIR=./public
PEEK_TOKEN=your-secret-token
PEEK_READONLY=falseCreate .peekignore to hide files:
node_modules
.git
.env
*.log
.DS_Store
curl http://127.0.0.1:3000/~/
curl "http://127.0.0.1:3000/~/?sortBy=modified&sortDir=desc"curl http://127.0.0.1:3000/f/document.pdf
curl http://127.0.0.1:3000/f/image.jpg?download=1curl -X POST http://127.0.0.1:3000/api/files \
-H "Content-Type: application/json" \
-d '{"path":"newfile.txt","content":"Hello"}'curl -X POST http://127.0.0.1:3000/api/upload \
-F "file=@document.pdf" \
-F "path=/documents/"curl -X PUT http://127.0.0.1:3000/api/rename \
-H "Content-Type: application/json" \
-d '{"oldPath":"old.txt","newPath":"new.txt"}'curl -X DELETE http://127.0.0.1:3000/api/delete \
-H "Content-Type: application/json" \
-d '{"path":"file.txt"}'peek/
├── bin/peek.js - CLI entry point
├── src/
│ ├── security.js - Auth, validation, rate limiting
│ ├── server.js - HTTP server core
│ ├── fileSystem.js - File operations
│ ├── config.js - Configuration
│ ├── logger.js - Logging
│ ├── cli.js - Interactive CLI
│ ├── features.js - File analysis
│ ├── recovery.js - Trash system
│ ├── search.js - Search features
│ ├── batch.js - Batch operations
│ ├── watcher.js - File monitoring
│ ├── routes/
│ │ ├── api.js - JSON API endpoints
│ │ └── pages.js - HTML pages
│ └── ui/
│ ├── client.js - Browser JavaScript
│ ├── layout.js - HTML builder
│ └── styles.js - CSS styles
├── package.json
├── README.md
└── .peekignore
- Path Traversal - Normalized path validation with separator checks
- Missing Authentication - Token-based auth with timing-safe comparison
- Symlink Bypass - Realpath validation with recursive checks
- Binary Corruption - Multipart upload with binary-safe handling
- No Size Limits - Request body and file size limits enforced
- No CSRF - Origin header validation on state-changing requests
- No Rate Limiting - Fixed-window rate limiter (300 req/min)
- XSS Prevention - Content-Security-Policy headers active
- Fail-closed validation
- Timing-safe token comparison
- Security headers (CSP, X-Frame-Options, Referrer-Policy)
- HTTPS ready (with Referrer-Policy: no-referrer)
- CORS-ready (Origin validation)
- Lightweight - ~50KB on disk (without node_modules)
- Fast - Responds in <100ms for typical operations
- Scalable - Rate limiting prevents abuse
- Memory Efficient - Streaming file upload/download
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT License - see LICENSE file for details
See CHANGES.md for detailed changelog and security fixes.
Built with ❤️ by Aydope