new Server(config)
Represents a server
Parameters:
Name | Type | Description |
---|---|---|
config |
object | The configuration |
- 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.
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 |
|
||||||
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 |
||||||
config.liveReload.enabled |
boolean | Enable or disable the |
||||||
config.liveReload.options |
object | The liveReload options Properties
|
||||||
config.verbose |
boolean | Enables / disables the verbose output |
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:
- Server#event:error
- Server#liveReload.event:ready
- Server#event:stdout
- Server#event:stderr
- Server#event:exit
Returns:
- Type
- Promise
-
start() → {Promise}
-
Fires:
- Server#event:error
- Server#liveReload.event:ready
- Server#event:stdout
- Server#event:stderr
- Server#event:exit
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: