Skip to content

AyushWalekar/p2p-file-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

p2p-file-sync

A lightweight, dual-pane file browser for Node.js that makes comparing and navigating local directories a breeze. Built with vanilla JavaScript and Node.js — no build tools, no frameworks, just pure simplicity.

Features

  • Dual-Pane Interface — Side-by-side file browsing and comparison
  • Gitignore Support — Automatically respects .gitignore patterns
  • Custom Ignore Rules — Configure .syncignore for project-specific filtering
  • Real-time File Operations — Read, compare, and navigate files on the fly
  • Dark Mode UI — Built with a VS Code-inspired dark theme
  • Zero Dependencies — Pure Node.js and browser APIs

Installation

Clone the repository and you're ready to go. No npm install required.

git clone <repository-url>
cd file-browser-node

Usage

Start the server:

node server.js [directory]

By default, the server serves the current working directory on port 3000. You can specify a custom directory as an argument.

Environment Variables

Variable Description Default
PORT Server port 3000
SYNC_TOKEN Optional authentication token for sync operations ""

Demo

Demo Screenshot

Configuration

Ignoring Files

The browser respects the following ignore patterns (in order of precedence):

  1. Default ignores: .git/, node_modules/, .DS_Store
  2. .gitignore patterns in the served directory
  3. .syncignore patterns in the served directory

Ignore patterns follow standard glob syntax:

  • *.log — ignores all .log files
  • build/ — ignores the entire build directory
  • *.min.js — ignores minified JavaScript files

API Endpoints

  • GET / — Main file browser interface
  • GET /api/files — List files with filtering
  • GET /api/file — Read file contents
  • POST /api/compare — Compare multiple files

Development

The project is intentionally simple and straightforward:

  • server.js — Node.js HTTP server with file operations
  • index.html — Single-page frontend application

License

MIT

About

Lightweight P2P file sync across devices - no ext dependencies except Node.js

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors