Packages
OS.js Package Management
Constructor Summary
Public Constructor | ||
public |
constructor(core: Core, options: PackagesOptions) Create new instance |
Member Summary
Public Members | ||
public |
|
|
public |
|
|
public |
|
Method Summary
Public Methods | ||
public |
createLoader(): Promise<Package[]> Loads all packages |
|
public |
Destroys packages |
|
public |
handleMessage(ws: WebSocket, params: Array) Handles an incoming message and signals an application |
|
public |
init(): * Initializes packages |
|
public |
initializePackage(pkg: *, manifest: *, done: *): Promise<Package> Initializes a package |
|
public |
Loads package manager |
|
public |
loadPackage(filename: string, manifest: PackageMetadata): Promise<Package> Loads package data |
|
public |
onPackageChanged(pkg: Package) When a package dist has changed |
|
public |
start() Starts packages |
Public Constructors
public constructor(core: Core, options: PackagesOptions) source
Create new instance
Params:
Name | Type | Attribute | Description |
core | Core | Core reference |
|
options | PackagesOptions |
|
Instance options |
Public Members
public options: PackagesOptions source
Public Methods
public handleMessage(ws: WebSocket, params: Array) source
Handles an incoming message and signals an application
This will call the 'onmessage' event in your application server script
Params:
Name | Type | Attribute | Description |
ws | WebSocket | Websocket Connection client |
|
params | Array | A list of incoming parameters |
public initializePackage(pkg: *, manifest: *, done: *): Promise<Package> source
Initializes a package
Params:
Name | Type | Attribute | Description |
pkg | * | ||
manifest | * | ||
done | * |
public loadPackage(filename: string, manifest: PackageMetadata): Promise<Package> source
Loads package data
Params:
Name | Type | Attribute | Description |
filename | string | Filename |
|
manifest | PackageMetadata | Manifest |