Alpha: this compiler is under active development and updates will break your projects. Not recommended for real use yet.
Skip to content

twine / DatapackFactory

Class: DatapackFactory โ€‹

Defined in: twine/src/core/factory/factory.ts:39

Builds a Datapack from a root module, like NestJS's NestFactory.create.

area modules gate their subtree: its ticks only run while the area's active flag is 1, so a dormant area costs one check per tick. Areas get <name>/activate and <name>/deactivate.

Constructors โ€‹

Constructor โ€‹

new DatapackFactory(): DatapackFactory

Returns โ€‹

DatapackFactory

Methods โ€‹

create() โ€‹

static create(root, opts): Datapack

Defined in: twine/src/core/factory/factory.ts:41

Builds a new Datapack from the module tree rooted at root.

Parameters โ€‹

root โ€‹

ModuleClass

opts โ€‹

FactoryOptions

Returns โ€‹

Datapack


mount() โ€‹

static mount(dp, root, opts?): Datapack

Defined in: twine/src/core/factory/factory.ts:52

Wires the module tree into an existing dp, e.g. the one the helix CLI created. create does this on a new Datapack.

Parameters โ€‹

dp โ€‹

Datapack

root โ€‹

ModuleClass

opts? โ€‹
env? โ€‹

BuildEnv

only? โ€‹

string[]

Returns โ€‹

Datapack

Released under the MIT License ยท Credits
These docs were written with AI; the layout and every page have been reviewed by a human.