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

file-sharing-service

v1.0.0

Published

A CLI-based file-sharing service with TypeScript, Node.js, PostgreSQL, and MinIO

Downloads

5

Readme

File Sharing Service

A self-hostable, cloud-native file sharing service with a CLI interface. Built with TypeScript, Node.js, PostgreSQL, and MinIO.

Features

  • Simple CLI Interface: Upload files with a single command
  • Secure File Sharing: Generate unique links for each file
  • Password Protection: Optionally protect files with passwords
  • Expiration Control: Set expiration times for shared files
  • Self-Contained: Entire stack runs in Docker containers
  • Type-Safe: End-to-end type safety with TypeScript and Prisma

Architecture

This project follows a modular, feature-based architecture with clean separation of concerns:

  • Backend: Express.js REST API with TypeScript
  • Database: PostgreSQL with Prisma ORM
  • Storage: MinIO (S3-compatible object storage)
  • CLI: Commander-based command-line interface

Prerequisites

  • Docker and Docker Compose
  • Node.js 16+ (for local development)

Quick Start

Running with Docker Compose

  1. Clone the repository:
git clone https://github.com/yourusername/file-sharing-service.git
cd file-sharing-service
  1. Create a .env file from the example:
cp .env.example .env
  1. Start the entire stack with Docker Compose:
docker-compose up --build

This will start the backend server, PostgreSQL database, and MinIO storage service.

  1. The services will be available at:
    • Backend API: http://localhost:3000
    • MinIO Console: http://localhost:9001 (login with credentials from docker-compose.yml)

First-Time Setup

After the first launch, you may need to:

  1. Log in to the MinIO console at http://localhost:9001 using:

    • Username: minio-root-user
    • Password: minio-root-password
  2. Verify that the uploads bucket has been created automatically.

Using the CLI Tool

Installation

# Install from npm
npm install -g file-sharing-service

# Or install locally from the repository
npm install -g .

Commands

Upload a File

fileshare upload /path/to/file.txt

Upload with Expiration (in seconds)

fileshare upload /path/to/file.txt --expires 86400  # Expires in 24 hours

Upload with Password Protection

fileshare upload /path/to/file.txt --password mysecretpassword

Combine Options

fileshare upload /path/to/file.txt --expires 3600 --password mysecretpassword

Development

Setup

  1. Install dependencies:
npm install
  1. Generate Prisma client:
npm run db:generate
  1. Run database migrations:
npm run db:migrate
  1. Start the development server:
npm run dev

Git Hooks

This project uses Husky to enforce code quality and prevent common mistakes:

  • Pre-commit Hook: Prevents committing .env files and runs TypeScript type checking
  • Commit Message Hook: Enforces conventional commit message format
  • Pre-push Hook: Validates branch naming conventions

Commit Message Format

Commit messages must follow the Conventional Commits specification:

<type>(<optional scope>): <description>

[optional body]

[optional footer(s)]

Valid types: build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test

Branch Naming Convention

Branch names should follow the format: type/description

Valid types: feature, bugfix, hotfix, release, chore, docs, refactor, test

Examples:

  • feature/add-login
  • bugfix/fix-upload-issue

Building

npm run build

API Endpoints

Upload

  • POST /upload/url: Get a presigned URL for direct upload to MinIO

Download

  • GET /download/:slug: Download a file by its unique slug
  • GET /download/:slug/info: Get file information without downloading

License

MIT