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

servejss

v0.0.5

Published

Static file server with REST write support - npx serve alternative

Readme

servejss

Static file server with REST write support. A drop-in npx serve alternative.

npm version License: MIT

Why?

npx serve is great for quickly serving static files, but it's read-only. Sometimes you need to:

  • Upload files during development
  • Test REST APIs locally
  • Sync files between devices on your LAN
  • Have a simple WebDAV-like server

servejss is serve with superpowers: same simple interface, but you can write too.

Install

npm install -g servejss

Or use directly with npx:

npx servejss

Usage

# Serve current directory (read + write enabled)
servejss

# Serve specific directory
servejss ./public

# Custom port
servejss -p 8080

# Specify port and directory
servejss -l 3000 ./dist

# Read-only mode (exactly like npx serve)
servejss --read-only

Output

 servejss

  Directory:  /home/user/project

  Local:      http://localhost:3000
  Network:    http://192.168.1.5:3000

  Mode:       GET/PUT/DELETE enabled

  Press Ctrl+C to stop

REST API

# Read a file
curl http://localhost:3000/file.txt

# Create or update a file
curl -X PUT -d "Hello, World!" http://localhost:3000/file.txt

# Delete a file
curl -X DELETE http://localhost:3000/file.txt

# Conditional update (only if ETag matches)
curl -X PUT -H 'If-Match: "abc123"' -d "Updated" http://localhost:3000/file.txt

# Create only if doesn't exist
curl -X PUT -H 'If-None-Match: *' -d "New file" http://localhost:3000/new.txt

Options

Usage: servejss [options] [directory]

Options:
  -v, --version            Output version number
  -l, --listen <uri>       Specify a URI endpoint on which to listen
  -p, --port <port>        Specify custom port (default: 3000)
  -H, --host <host>        Host to bind to (default: 0.0.0.0)
  -s, --single             Rewrite all not-found requests to index.html (SPA mode)
  -d, --debug              Show debugging information
  -C, --cors               Enable CORS (enabled by default)
  -L, --no-request-logging Do not log any request information
  --no-etag                Disable ETag generation
  -S, --symlinks           Resolve symlinks instead of showing 404
  --ssl-cert <path>        Path to SSL certificate
  --ssl-key <path>         Path to SSL private key
  --no-port-switching      Do not open a different port if specified one is taken
  -r, --read-only          Disable PUT/DELETE methods (like npx serve)
  --auth <credentials>     Enable basic auth (user:pass)
  --solid                  Enable full Solid protocol features
  -q, --quiet              Suppress all output
  -h, --help               Display help

Comparison with serve

| Feature | serve | servejss | |---------|-------|---------| | Static file serving | ✅ | ✅ | | Directory listings | ✅ | ✅ | | CORS | ✅ | ✅ | | SPA mode | ✅ | ✅ | | Custom port | ✅ | ✅ | | Auto port switching | ✅ | ✅ | | SSL/TLS | ✅ | ✅ | | PUT (create/update) | ❌ | ✅ | | DELETE | ❌ | ✅ | | ETags | ❌ | ✅ | | Conditional requests | ❌ | ✅ | | Upgrade to Solid | ❌ | ✅ |

Advanced Features

Conditional Requests

servejss supports ETags for efficient caching and safe concurrent updates:

# Get a file with its ETag
curl -i http://localhost:3000/file.txt
# Returns: ETag: "a1b2c3"

# Only fetch if changed
curl -H 'If-None-Match: "a1b2c3"' http://localhost:3000/file.txt
# Returns: 304 Not Modified (if unchanged)

# Safe update (fails if file changed since you read it)
curl -X PUT -H 'If-Match: "a1b2c3"' -d "new content" http://localhost:3000/file.txt

Upgrade to Solid

servejss is powered by JSS (JavaScript Solid Server). Enable full Solid protocol support:

servejss --solid

This enables:

  • Solid-OIDC authentication
  • Web Access Control (WAC)
  • Linked Data support (Turtle, JSON-LD)
  • WebID profiles

Use Cases

Local Development Server

# Serve your project with write support for uploads
cd my-project
servejss

Quick File Sharing on LAN

# Share files with devices on your network
servejss --read-only ~/shared-files

REST API Testing

# Mock a simple REST backend
servejss ./mock-data

WebDAV Alternative

# Lightweight file sync server
servejss --auth user:pass ~/sync

License

MIT

Related Projects

  • JSS - Full Solid server
  • serve - Static file serving (read-only)