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

file2site

v0.1.8

Published

Zero-config CLI that turns a single Markdown or HTML file into a beautiful live website.

Readme

MIT License

File2Site

A zero-config CLI that turns a single Markdown, HTML, JSON, or YAML file into a beautiful live website with advanced features.

Quick Start

npx file2site README.md

Features

Core Features

  • 🚀 Zero Configuration - No config files needed
  • 📝 Multiple Formats - Markdown, HTML, JSON, YAML, and text files
  • 🔄 Live Reload - Instant browser refresh on file saves with auto-reconnect
  • 🌐 Auto Browser Launch - Opens automatically (disable with --no-open)
  • 📱 QR Code - Easy mobile access with --qr flag

Enhanced Markdown

  • Syntax Highlighting - Code blocks with highlight.js
  • 📑 Table of Contents - Auto-generated with [[toc]]
  • Task Lists - GitHub-style checkboxes
  • 🔗 Smart Links - External links open in new tab
  • 🎯 Anchor Links - Auto-generated heading anchors
  • 📊 Mermaid Diagrams - Built-in diagram support
  • 🔢 Math Equations - KaTeX support for formulas

Security

  • 🔒 HTML Sanitization - XSS protection for user content
  • 🛡️ CSP Headers - Content Security Policy enabled
  • 🚫 Path Validation - Protection against directory traversal

Customization

  • 🎨 Custom CSS - Inject your own styles with --css
  • 🌓 Dark Mode - Built-in theme toggle with --dark-mode
  • Performance - Intelligent caching for faster renders
  • ⏱️ Configurable Debounce - Adjust watch sensitivity with --debounce

Export Options

  • 📄 HTML Export - Generate standalone HTML files
  • 📑 PDF Export - Create PDFs with --export-pdf

Developer Experience

  • 📊 Verbose Mode - Detailed logging with --verbose
  • 🔄 Port Retry - Automatic port conflict resolution
  • 🎯 TypeScript - Full type safety
  • 🧪 Tested - Comprehensive test suite

CLI

file2site <file> [options]

Options

  • --port <number> - Use a specific port (finds alternative if taken)
  • --no-open - Don't open browser automatically
  • --export - Export static HTML and exit
  • --export-pdf - Export PDF (requires --port)
  • --css <file> - Path to custom CSS file
  • --dark-mode - Enable dark mode toggle button
  • --debounce <ms> - File watch delay (default: 80ms)
  • --verbose - Enable detailed logging
  • --qr - Show QR code for mobile access

Examples

# Basic usage
file2site README.md

# Custom port with dark mode
file2site docs.md --port 3000 --dark-mode

# Export with custom styles
file2site page.md --export --css custom.css

# PDF export
file2site report.md --export-pdf --port 8080

# Mobile development with QR code
file2site app.html --qr --no-open

# Verbose mode for debugging
file2site config.json --verbose

Use Cases

  • 📚 Documentation Preview - See docs as they'll appear
  • 🎨 Quick Landing Pages - Single markdown to website
  • 🔧 HTML Prototypes - Share demos without frameworks
  • 📱 Mobile Testing - QR codes for easy device access
  • 📊 Data Visualization - Pretty-print JSON/YAML
  • 📝 README Walkthroughs - Production-ready previews
  • 📄 Report Generation - Markdown to PDF workflows

Advanced Features

Mermaid Diagrams

\`\`\`mermaid
graph TD
    A[Start] --> B[Process]
    B --> C[End]
\`\`\`

Math Equations

Inline: $E = mc^2$

Block:
$$
\frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
$$

Custom Styling

# Create custom.css
echo "body { font-family: 'Comic Sans MS'; }" > custom.css

# Use it
file2site README.md --css custom.css

Non-Goals

  • ❌ Multiple pages or routing
  • ❌ Build-time configuration files
  • ❌ Framework integration
  • ❌ Hosting or deployment features

Technical Details

Security

  • HTML Sanitization - All user HTML is sanitized using sanitize-html
  • CSP Headers - Strict Content Security Policy
  • Path Validation - Prevents directory traversal attacks
  • XSS Protection - Multiple layers of protection

Performance

  • Intelligent Caching - Rendered content cached until file changes
  • Efficient Watching - Debounced file system monitoring
  • Lazy Loading - Resources loaded on demand

Export Details

  • --export writes file.html for Markdown inputs
  • Non-Markdown files get .file2site.html suffix to avoid overwriting
  • --export-pdf uses Puppeteer for high-quality PDF generation
  • Exported files include all styles inline for portability

Supported Extensions

  • .md - Markdown with full feature support
  • .html - HTML with sanitization
  • .json - Syntax highlighted JSON
  • .yaml, .yml - Syntax highlighted YAML
  • .txt - Plain text in code blocks

Development

# Install dependencies
npm install

# Run in development mode
npm run dev -- README.md

# Run tests
npm test

# Run tests with UI
npm run test:ui

# Build
npm run build

# Type check
npm run typecheck

License

MIT