Represents a Datapack Expander that expand an exported datapack into a list of files that can be written to the file system or a zip archive. The expander can be used to expand a single datapack or a list of datapacks.

Usage

const expander = container.create(DatapackExpander);
const result = expander.expandDatapack(datapack);

for (const [fileName, fileData] of Object.entries(result.files)) {
await fs.writeFile(fileName, fileData);
}

Hierarchy

  • DatapackExpander

Constructors

Properties

datapackStandardFields: string[] = ...

Configuration for the Datapack Exporter instance.

fieldTypeExtension: {
    array: string;
    binary: string;
    json: string;
} = ...

Type declaration

  • array: string
  • binary: string
  • json: string
logger: Logger
datapackFileName: string = 'DataPack.json'

Methods