Class: Server

Server

new Server(config)

Represents a server

Parameters:
Name Type Description
config object

The configuration

Properties:
Name Type Description
config.cwd string

The process root path

config.executable string

If defined the executable path is used instead of the script.path

config.script.runner string

node / io js executable

config.script.path string

The script

config.process.args array

The arguments passed to the process

config.process.options object

The options passed to the process

config.process.encoding string

The encoding (defaults to utf8)

config.liveReload.enabled boolean

Enable or disable the liveReload plugin

config.liveReload.options object

The liveReload options

Properties
Name Type Description
port number

The liveReload port

config.verbose boolean

Enables / disables the verbose output

Author:
License:
  • Copyright (c) 2015 Marc Binder Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Fires:
Listens to Events:

Members

config :config

Type:
  • config

Methods

<static> task(gulp, config) → {Server}

Parameters:
Name Type Description
gulp object

An instance of gulp

config object

The configuration object.

Properties:
Name Type Description
config.notify array
config.restart array
config.server object

The server configuration (described above)

Returns:
Type
Server

notify(info) → {Server}

Parameters:
Name Type Description
info object
Returns:
Type
Server

off(event, listener)

Remove a listener from the listener array for the specified event. Caution: changes array indices in the listener array behind the listener.

Parameters:
Name Type Description
event string

The event name as a string

listener function

The listener function

Returns:

Server

on(event, listener)

Adds a listener to the end of the listeners array for the specified event.

Parameters:
Name Type Description
event string

The event name as a string

listener function

The listener function

Returns:

Server

once(event, listener)

Parameters:
Name Type Description
event string

The event name as a string

listener function

The listener function

Returns:

Server

restart() → {Promise}

Fires:
Returns:
Type
Promise

start() → {Promise}

Fires:
Returns:
Type
Promise

stop() → {Promise}

Fires:
Returns:
Type
Promise

watchAndNotify(info) → {Stream}

Parameters:
Name Type Argument Description
info mixed <optional>
Returns:
Type
Stream

Events

changed

Listeners of This Event:

error

Parameters:
Name Type Description
err Error | mixed

The error

Listeners of This Event:

exit

Parameters:
Name Type Description
code number
signal string
Listeners of This Event:

stderr

Parameters:
Name Type Description
value string
Listeners of This Event:

stdout

Parameters:
Name Type Description
value string
Listeners of This Event: