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 ๐Ÿ™

ยฉ 2024 โ€“ย Pkg Stats / Ryan Hefner

serw

v0.1.0

Published

Serve static files with ease. ๐ŸŽ†

Downloads

8

Readme

serw ๐Ÿฅฝ npm

Serve static files with ease. ๐ŸŽ†

Getting Started

Easiest way to get started is by just typing npx serw which will start a static HTTP server from your current directory.

โš  By default serw will attempt to find public directory and serve files from there. To avoid this behavior type serw ..

Alternatively, you can manually install the package globally:

npm i serw --global

...and then run it in your project's directory:

serw folder-name/ [options]

Features

  • ๐Ÿ›ก๏ธ Integration with SSL/TLS certificate.
  • ๐ŸŒ ETag, CORS, Cache-Control headers.
  • ๐Ÿ”’ Basic password authentication.
  • ๐Ÿ“ Ignore files with support for globs.
  • ๐Ÿšจ Customizable HTTP error handlers

Configuration

To show a full list of available options run serw --help.
Every option can be negated with --no prefix, e.g. --no-open or -o=false.

๐Ÿ’ก You can also configure serw with serw.json file.

For now this package is only a CLI tool and has no built-in programmatic integration yet. I recommend against using serw in production and only using it in development.

Options

--host, -H

Type: string
Default: localhost

Hostname to bind.

--port, -p

Type: number
Default: 3000

Port to bind.

--index, -m

Type: string
Default: index.html

Path to the main page file.

--dot-files, -d

Type: boolean
Default: false

Show dot files, e.g. .env.

--ignore-files, -i

Type: array

List of files to ignore.

--dir-listing, -l

Type: boolean
Default: true

Enable directory listing.

--error-page, -E

Type: string
Default: 404.html

Path to a file to display when an error occurred.

--open, -o

Type: boolean
Default: true

Whether to open browser window after the server starts.

--robots, -r

Type: boolean
Default: false

Automatically handle /robots.txt.

--cors, -c

Type: boolean
Default: false

Enable CORS headers.

--etag, -e

Type: boolean
Default: false

Enable ETag headers.

--max-age, -M

Type: number
Default: undefined

Enable Cache-Control header and set maxAge (seconds).

--immutable, -I

Type: boolean
Default: false

Appends Cache-Control header with immutable.

--password, -p

Type: string

Enable simple authentication via a password.

--ssl, -s

Type: boolean
Default: false

Enable SSL/TLS for HTTPS.

--key, -K

Type: string
Default: key.pem

Path to SSL certificate key.

--cert, -C

Type: string
Default: cert.pem

Path to SSL certificate file.

--config

Type: string
Default: serw.json

Path to the config json file.

--log-ip

Type: boolean
Default: false

Log IP address of the client's request.

--log-agent

Type: boolean
Default: false

Log User-agent of the client's request.

--log-timestamp

Type: boolean
Default: true

Log timestamp.

--clear-console

Type: boolean
Default: true

Clear console after the server starts.

--silent

Type: boolean
Default: false

Disable logging entirely.

License

MIT ๐Ÿ’–