sable
TypeScript icon, indicating that this package has built-in type declarations

0.5.14 • Public • Published

Sable

test codecov

Starts a server for development.

Install

npm install sable --save-dev

CLI

$ sable -h
Usage: sable [options] <documentRoot ...>

Starts a HTTP server for development

Options:
  -V, --version    output the version number
  -p, --port <n>   A port number for HTTP, HTTPS (4000)
  -h, --host <s>   Hostname
  --noWatch        Disable watching
  -i, --index <s>  A filename of index (index.html)
  -h, --help       output usage information

Javascript API

import {startServer} from 'sable';
startServer({/* options */})
.then((server) => console.log(server.address()))

Options

startServer supports all of the options provided by middleware-static-livereload , port, host and middlewares.

interface SableOptions extends MiddlewareStaticLivereload.Options {
    /**
     * The first argument of server.listen()
     * https://nodejs.org/api/net.html#net_server_listen_port_host_backlog_callback
     * @default 4000
     */
    port?: number,
    /**
     * The second argument of server.listen()
     * https://nodejs.org/api/net.html#net_server_listen_port_host_backlog_callback
     * @default undefined
     */
    host?: string,
    /**
     * A list of middlewares.
     * @default []
     */
    middlewares?: Array<connect.HandleFunction>,
}

LICENSE

The sable project is licensed under the terms of the Apache 2.0 License.

Readme

Keywords

none

Package Sidebar

Install

npm i sable

Weekly Downloads

6

Version

0.5.14

License

Apache-2.0

Unpacked Size

15.5 kB

Total Files

6

Last publish

Collaborators

  • kei-ito