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

@amio/serve

v2.1.0

Published

Simple command-line file / directory server built with connect

Downloads

13

Readme

@amio/serve npm-version

Handy http/https server, evolved from TJ's original serve, which inspired by nodejitsu's http-server.

Original serve is awesome, but seems lacks of maintenance these days, there's some useful fixes & features added to the codebase since it's latest release in Mar 2014, but couldn't get landed to users, it's more than two years by now.
So here is this ongoing serve, and also an opinionated serve, which removed support for jade and stylus, for a much smaller installation footprint.

Difference with serve:

  • Doesn't support jade and stylus (Opinionated),
  • so comes minimal installation footprint (1.8M vs 15M).
  • -o, --open opens a browser window to this server.
  • -s, --https also serve over https.

Installation

$ npm install -g @amio/serve

Usage

Usage: serve [options] [dir]

Options:

  -h, --help                output usage information
  -V, --version             output the version number
  -o, --open                opens a browser window to this server
  -a, --auth <user>:<pass>  specify basic auth credentials
  -F, --format <fmt>        specify the log format string
  -p, --port <port>         specify the port [3000]
      --https-port <port>   specify the port [3443]
  -H, --hidden              enable hidden file serving
  -I, --no-icons            disable icons
  -L, --no-logs             disable request logging
  -D, --no-dirs             disable directory serving
  -f, --favicon <path>      serve the given favicon
  -c, --cors                allows cross origin access serving
  -s, --https               also serve over https
      --key                 key file path for https
      --cert                certificate file for https
      --ca                  CA certificate file for https
      --compress            gzip or deflate the response
      --exec <cmd>          execute command on each request

Examples

HTTP Accept support built into connect.directory():

$ curl http://localhost:3000/ -H "Accept: text/plain"

  bin
  History.md
  node_modules
  package.json
  Readme.md

Requesting a file:

$ curl http://localhost:3000/README.md

Requesting JSON for the directory listing:

$ curl http://localhost:3000/ -H "Accept: application/json"
["bin","History.md","node_modules","package.json","Readme.md"]

Directory listing served by serve-index middleware.

License

MIT License (c) 2011 TJ Holowaychuk