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

@welib/express-webfs

v0.0.1

Published

Express.js middleware to handle GET, PUT, DELETE

Readme

The @welib/express-webfs package exposts Express.js middleware which exposes a filesystem directory over a REST API. Analogous to the express-static middleware, but with support for writing.

Quick Start

This example sets up a local web server to serve files from /var/lib/webfs. The server supports HEAD, GET, PUT, and DELETE requests.

import http from "http";
import express from "express";
import webfs from "@welib/express-webfs";

const app = express();

app.use(webfs("/var/lib/webfs"));

http.createServer(app).listen(null, "127.0.0.1", function() {
  const {address, port} = this.address();
  console.info(`listening on ${address}`)
})

Options

The webfs middleware accepts a second argument of options to configure. The following features are supported.

Read-Only Mode

The webfs middleware can be configured in read-only mode to disable PUT and DELETE requests.

app.use(webfs(root_dir, {readOnly: true}));

Simple Update Mode

Typically, the webfs middleware will not allow updates (PUT/DELETE) without If-Match or If-None-Match headers to control synchronization between multiple clients. If you prefer simpler (but less safe) updates, the middleware can be configured to allow simple updates.

app.use(webfs(root_dir, {simpleUpdate: true}));

Temp File Path

By default, when PUT requests are handled, the middleware will save the uploaded resource file to the .tmp directory inside the middleware root directory. This temp directory can be adjusted by setting an alternative absolute path, a path relative to the target resource, or null to save files alongside the target resource file in the same directory.

app.use(webfs(root_dir, {temp: ".uploads"}));

Configuring MIME Types

The webfs middleware makes use of the popular NPM package mime-db by default. If you wish to override this, you can pass in an object in a similar format.

app.use(webfs(root_dir, {
  mime: {
    "text/plain": {
      "charset": "us-ascii",
      "extensions": ["txt", "text"]
    },
    "text/markdown": {
      "extensions": ["md"]
    }
  }
}))

Maximum File Size

By default, the webfs middleware will limit uploaded files to 20 MiB. This limit can be configured to be smaller or large, and can be set to Infinity to remove the limit (not recommended).

app.use(webfs(root_dir, {maxSize: Infinity}));