Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

servitsy

Package Overview
Dependencies
Maintainers
0
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

servitsy

Small, local HTTP server for static files

  • 0.3.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
68
decreased by-17.07%
Maintainers
0
Weekly downloads
 
Created
Source

servitsy

Small, local HTTP server for static files.

  • Small: no dependencies, 26 kilobytes gzipped.
  • Local: designed for local development workflows.
  • Static: serves files and directory listings.
Web browser screenshot of a directory listing for the servitsy source code, served by servitsy on localhost:8080

Usage

npx servitsy [directory] [options]

[!NOTE] servitsy is a command-line tool, published as a npm package. It requires Node.js version 18 or higher, or a compatible runtime like Deno or Bun.

# Running with Bun
bunx servitsy

# Running with Deno
deno run --allow-net --allow-read --allow-sys npm:servitsy

Calling servitsy without options will:

  • serve the current directory at http://localhost:8080 (listening on hostname 0.0.0.0);
  • try the next port numbers if 8080 is not available;
  • serve index.html files for folders, and .html files when the extension was omitted in the URL;
  • serve directory listings (for folders without an index file).

Options

You can configure servitsy's behavior with options. For example:

# Serve current folder on port 3000, with CORS headers
npx servitsy -p 3000 --cors

# Serve 'dist' folder and disable directory listings
npx servitsy dist --dir-list false
  • Use npx servitsy --help for an overview of available options.
  • Read doc/options.md for details and examples.

Changelog

See doc/changelog.md for the release history.

License

This package is licensed under the MIT license.

Alternatives

[!WARNING] servitsy is not designed for production. There are safer and faster tools to serve a folder of static HTML to the public. See Apache, Nginx, @fastify/static, etc.

For local testing, here are a few established alternatives you may prefer, with their respective size:

PackageVersionDependenciesInstalled size†
servitsy0.3.30128 kB
servor4.0.20144 kB
sirv-cli3.0.012396 kB
serve14.2.3897.6 MB
http-server14.1.1458.9 MB

If size and dependency count is not a concern and you want something stable and battle-tested, I recommend serve and http-server.

Otherwise, servor, sirv-cli or servitsy might work for you.

† Installed size is the uncompressed size of the package and its dependencies (as reported by du on macOS; exact size may depend on the OS and/or filesystem).

Keywords

FAQs

Package last updated on 13 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc