@logicssoldier/publish-folder
v1.0.6
Published
Quick Express.js app to publish and browse folder contents
Downloads
650
Maintainers
Readme
@LogicsSoldier's
Publish Folder
A simple Express.js application to quickly publish and browse folder contents via web interface. View files and folders in a clean interface on any device and download with a single click.
It's only 300 lines of code and 2 dependencies, express & archiver -- you really can read it.
Features
- 📁 Browse folders and files with a clean web interface
- 📥 Download files with one click
- 🎨 Responsive design that works on mobile and desktop
- 🔒 Security: prevents access outside the published folder
- 📊 Shows file sizes and modification dates
- 🚀 Fast and lightweight
Installation
# if you trust me and want to add the command to path so you can use it anywhere
# (whole package -dependencies is only 300 lines of code.. only 2 dependecies)
npm install -g @logicssoldier/publish-folder
# OR --------
# can also download the package from npm or github and run from the folder without needing admin privelage
npm pack @logicssoldier/publish-folder
# pick whichever you're comfortable with!
Usage
Publish a specific folder:
# if global
publish-folder /path/to/folder
# otherwise find npm package and..
node server.js /path/to/folderCustom port:
PORT=8080 npm startHow It Works
- Cd into your chose directory and start the server with
publish-folder - Open your browser to
http://localhost:3000 - Browse folders by clicking on them
- Download files by clicking on them
- Use the breadcrumb navigation or ".." to go back
- click the download button to download the entire directory zipped up
Examples
Publish your Documents folder:
node server.js ~/DocumentsPublish current directory:
node server.jsPublish and use custom port:
PORT=8080 node server.js /path/to/folderSecurity
The application includes path traversal protection to ensure users cannot access files outside the published folder.
License
MIT
