Skip to content

Latest commit

 

History

History
250 lines (204 loc) · 6.42 KB

File metadata and controls

250 lines (204 loc) · 6.42 KB

Modules

dev-toolbox/files

Files module.

dev-toolbox

The dev-toolbox module.

dev-toolbox/server

Server module.

dev-toolbox/server/TempServer

The TempServer module.

Classes

TempServer

Functions

path(path)string

Returns a normalized path.

root([path])string

Returns a normalized path relative to the project's root directory.

getHost([host])string

Returns the host.

getPort([port])number

Returns a free port.

getUrl([host], [port])string

Returns the URL. The default URL is "http://127.0.0.1:8080".

startTempServer([...args])Promise.<TempServer>

Starts a temporary server for testing purposes.

dev-toolbox/files

Files module.

dev-toolbox

The dev-toolbox module.

dev-toolbox/server

Server module.

dev-toolbox/server/TempServer

The TempServer module.

TempServer

Kind: global class

new TempServer(host, port)

Creates a temporary server for test purposes.

ParamTypeDescription
hoststring

The port of the temporary server.

portnumber

The port of the temporary server.

tempServer.host ⇒ string

Returns the host.

Kind: instance property of TempServer
Returns: string - The host.

tempServer.port ⇒ number

Returns the port.

Kind: instance property of TempServer
Returns: number - The port.

tempServer.start() ⇒ Promise.<TempServer>

Starts the temporary server.

Kind: instance method of TempServer

tempServer.stop() ⇒ Promise.<TempServer>

Stops the temporary server.

Kind: instance method of TempServer

path(path) ⇒ string

Returns a normalized path.

Kind: global function
Returns: string - The normalized path.

ParamTypeDescription
pathstring

The path to be normalized.

root([path]) ⇒ string

Returns a normalized path relative to the project's root directory.

Kind: global function
Returns: string - The normalized path relative to the project's root directory.

ParamTypeDescription
[path]string

The path to use to normalize. If none given, only the project's root directory will be used.

getHost([host]) ⇒ string

Returns the host.

Kind: global function
Returns: string - The host.

ParamTypeDescription
[host]string

The host. The default host is "127.0.0.1".

getPort([port]) ⇒ number

Returns a free port.

Kind: global function
Returns: number - The free port.

ParamTypeDescription
[port]number

The port. If no port given, the default port is 8080.

getUrl([host], [port]) ⇒ string

Returns the URL. The default URL is "http://127.0.0.1:8080".

Kind: global function
Returns: string - The URL with the given port.

ParamTypeDescription
[host]string

The host. The default host is "127.0.0.1".

[port]number

The port. If no port given, the default port is 8080.

startTempServer([...args]) ⇒ Promise.<TempServer>

Starts a temporary server for testing purposes.

Kind: global function

ParamTypeDescription
[...args]*

If one argument is specified, that will be the (port). If two arguments, they will be the (host, port).