Skip to content

Classes

VltServer

Defined in: index.ts:74

This class handles the starting and stopping of the server, but the actual response handling is all done in the handleRequest function.

Extends

  • EventEmitter<{ needConfigUpdate: [string]; }>

Constructors

new VltServer()
new VltServer(options): VltServer

Defined in: index.ts:91

Parameters
options

VltServerOptions

Returns

VltServer

Overrides
EventEmitter<{
needConfigUpdate: [string]
}>.constructor

Properties

appData?
optional appData: AppDataManager;

Defined in: index.ts:80

assetsDir?
optional assetsDir: string;

Defined in: index.ts:88

config?
optional config: ConfigManager;

Defined in: index.ts:81

dashboard?
optional dashboard: Dashboard;

Defined in: index.ts:79

dashboardRoot
dashboardRoot: string[];

Defined in: index.ts:87

hasDashboard
hasDashboard: boolean = false

Defined in: index.ts:82

options
options: VltServerOptions

Defined in: index.ts:83

port?
optional port: number;

Defined in: index.ts:84

publicDir?
optional publicDir: string;

Defined in: index.ts:86

securityArchive
securityArchive:
| undefined
| SecurityArchive;

Defined in: index.ts:89

server
server: Server

Defined in: index.ts:85

Methods

address()
address(path): string

Defined in: index.ts:105

Parameters
path

string = '/'

Returns

string

close()
close(): Promise<void>

Defined in: index.ts:238

Returns

Promise<void>

listening()
listening(): this is VltServerListening

Defined in: index.ts:101

Returns

this is VltServerListening

start()
start(__namedParameters): Promise<void>

Defined in: index.ts:116

If no port is specified, then it’ll start counting up from 8000 until it finds one that does not fail with EADDRINUSE.

Parameters
__namedParameters

VltServerStartOptions = {}

Returns

Promise<void>

update()
update(this): Promise<void>

Defined in: index.ts:188

Parameters
this

VltServerListening

Returns

Promise<void>

updateGraph()
updateGraph(this): Promise<void>

Defined in: index.ts:166

Parameters
this

VltServerListening

Returns

Promise<void>

updateOptions()
updateOptions(options): void

Defined in: index.ts:174

Parameters
options

VltServerOptions

Returns

void

Type Aliases

VltServerListening

type VltServerListening = VltServer & object

Defined in: index.ts:58

Type declaration

assetsDir
assetsDir: string
config
config: ConfigManager
port
port: number
publicDir
publicDir: string

VltServerNotListening

type VltServerNotListening = VltServer & object

Defined in: index.ts:65

Type declaration

port
port: undefined
publicDir
publicDir: undefined

VltServerOptions

type VltServerOptions = InstallOptions &
UninstallOptions &
ActualLoadOptions &
object

Defined in: index.ts:40

Type declaration

assetsDir?
optional assetsDir: string;
dashboard-root?
optional dashboard-root: string[];
loadedConfig?
optional loadedConfig: LoadedConfig;
packageJson
packageJson: PackageJson
publicDir?
optional publicDir: string;

VltServerStartOptions

type VltServerStartOptions = object

Defined in: index.ts:54

Type declaration

port?
optional port: number;

Functions

createServer()

function createServer(options): VltServer

Defined in: index.ts:37

Parameters

options

VltServerOptions

Returns

VltServer


getProjectData()

function getProjectData(__namedParameters, folder): object

Defined in: graph-data.ts:82

Parameters

__namedParameters
packageJson

PackageJson

scurry

PathScurry

folder

PathBase

Returns

object

homedirRelativeRoot
homedirRelativeRoot: string
root
root: string
tools
tools: ProjectTools[];
vltInstalled
vltInstalled: boolean

readProjectFolders()

function readProjectFolders(
__namedParameters,
maxDepth,
): Promise<PathBase[]>

Defined in: read-project-folders.ts:41

Retrieves folders from a given directory, if that directory is recognized to be the current cli project root folder then we proceed to read its siblings.

Traverses nested directory recursively until project folders can be find, always stopping at the first level where a package.json is present.

Parameters

__namedParameters

ProjectFolderOptions

maxDepth

number = 7

Returns

Promise<PathBase[]>


reloadConfig()

function reloadConfig(folder): Promise<ParsedConfig>

Defined in: config-data.ts:26

Parameters

folder

string

Returns

Promise<ParsedConfig>