npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@snoggin-io/file-server

v1.0.0

Published

A simple, lightweight file upload server with a beautiful web interface and REST API

Readme

📁 File Server

A simple, lightweight file upload server with a beautiful web interface and REST API. Perfect for temporary file sharing, testing, and development workflows.

✨ Features

  • 🌐 Web Interface - Beautiful HTML upload form at http://localhost:3000
  • 🔗 REST API - Simple POST endpoint for programmatic uploads
  • 📂 Original Filenames - Preserves original file names
  • 🗂️ Temporary Storage - Uses system temp directory with auto-cleanup
  • 🎨 Modern UI - Responsive design with real-time feedback
  • 🔒 ISC License - Permissive open-source license

🚀 Quick Start

Using npx (Recommended)

npx @snoggin-io/file-server

No installation required! Starts immediately.

Global Installation

npm install -g @snoggin-io/file-server
file-server

Local Installation

npm install @snoggin-io/file-server
npx @snoggin-io/file-server

From Source

git clone https://github.com/snoggin-io/file-server.git
cd file-server
npm install
npm start

📖 Usage

Web Interface

  1. Start the server:

    npx @snoggin-io/file-server
  2. Open your browser to http://localhost:3000

  3. Select a file and click "Upload File"

  4. Get an instant shareable URL

API Usage

Upload a file via curl:

curl -X POST -F "[email protected]" http://localhost:3000/upload

Response:

{
  "filename": "document.pdf",
  "url": "http://localhost:3000/files/document.pdf"
}

Environment Variables

  • PORT - Server port (default: 3000)

Example:

PORT=8080 npx @snoggin-io/file-server

🔧 API Reference

POST /upload

Upload a file via multipart form-data.

Request:

  • Method: POST
  • Content-Type: multipart/form-data
  • Body: File with key file

Response:

{
  "filename": "example.pdf",
  "url": "http://localhost:3000/files/example.pdf"
}

Error Response:

{
  "error": "No file uploaded"
}

GET /files/:filename

Download or view an uploaded file.

Request:

  • Method: GET
  • Path: /files/{filename}

Response:

  • File content with appropriate headers

GET /

Access the web upload interface.

🏗️ Architecture

┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│   Web Browser   │────│   File Server   │────│  Temp Directory │
│                 │    │                 │    │                 │
│ Upload Form     │    │ Express.js      │    │ /tmp/file-      │
│ File Display    │    │ Multer          │    │ server-xxxxx/   │
└─────────────────┘    └─────────────────┘    └─────────────────┘

📁 File Storage

  • Files are stored in a unique temporary directory
  • Directory path: /tmp/file-server-{random}/ (Linux/macOS) or %TEMP%\file-server-{random}\ (Windows)
  • Auto-cleanup: Directory is removed when server shuts down
  • Collision handling: Files with same name will overwrite previous uploads

🔒 Security Considerations

  • Files are stored temporarily and cleaned up on exit
  • No authentication or authorization
  • Intended for development and testing environments
  • Not recommended for production without additional security measures

🛠️ Development

Prerequisites

  • Node.js 14+
  • npm or yarn

Setup

git clone https://github.com/snoggin-io/file-server.git
cd file-server
npm install

Scripts

npm start      # Start development server with ts-node
npm run build  # Build TypeScript to JavaScript

Project Structure

file-server/
├── src/
│   └── index.ts        # Main server code
├── dist/               # Compiled JavaScript
├── package.json
├── tsconfig.json
└── README.md

📦 Dependencies

  • express - Web framework
  • multer - File upload middleware
  • @types/express - TypeScript definitions
  • @types/multer - TypeScript definitions

🤝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the ISC License - see the LICENSE file for details.

🙋‍♂️ Support

  • 📫 Create an issue for bug reports or feature requests
  • ⭐ Star the repository if you find it useful
  • 🔄 Share with others who might benefit

🗂️ Use Cases

  • Quick File Sharing - Share files instantly without cloud storage accounts
  • Development Testing - Test file upload functionality in applications
  • Temporary File Hosting - Host files temporarily for demos or testing
  • CI/CD Pipelines - File transfer in automated workflows
  • Local Development - Mock file upload services during development
  • Prototyping - Quick file handling for prototypes and POCs
  • Cross-device Transfer - Transfer files between devices on same network

Made with ❤️ using Node.js and TypeScript