JSPM

  • Created
  • Published
  • Downloads 49095
  • Score
    100M100P100Q147012F
  • License MIT

A lightweight CLI program to serve static sites~!

Package Exports

  • sirv-cli
  • sirv-cli/boot

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (sirv-cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

sirv-cli

sirv-cli

A lightweight CLI program to serve static sites~!

Quickly start a server to preview the assets of any directory!

Just like serve, you may install and use sirv-cli globally or on a per-project basis.

Install

$ npm install --save sirv-cli

Note: This module can also be installed and used globally~!

Usage

Running sirv as a standalone command is an alias of sirv start, with the sole exception of displaying help text!

Note: This is because sirv-cli may include new commands in the future.
For example, compression may be extracted to a compress command, or watch may be added.

$ sirv --help

  Usage
    $ sirv <command> [options]

  Available Commands
    start    Start a static file server.

  For more info, run any command with the `--help` flag
    $ sirv start --help

  Options
    -v, --version    Displays current version
    -h, --help       Displays this message

  Examples
    $ sirv build --cors --port 8080
    $ sirv start build --cors --port 8080
    $ sirv public --quiet --etag --maxage 31536000 --immutable
    $ sirv start public -qeim 31536000
    $ sirv --port 8080 --etag
$ sirv start --help

  Description
    Start a static file server.

  Usage
    $ sirv start [dir] [options]

  Options
    -e, --etag         Enable "Etag" header
    -d, --dotfiles     Enable dotfile asset requests
    -c, --cors         Enable "CORS" headers to allow any origin requestor
    -m, --maxage       Enable "Cache-Control" header & define its "max-age" value (sec)
    -i, --immutable    Enable the "immutable" directive for "Cache-Control" header
    -s, --single       Serve single-page applications
    -q, --quiet        Disable logging to terminal
    -p, --port         Port to listen  (default 5000)
    -h, --help         Displays this message

License

MIT © Luke Edwards