yaml.load(filename, [vars])function

Loads and decodes YAML content from a file. See the yaml.decode() for more information on YAML decoding.

Parameters

filename

A File object or a filename string, representing the YAML file.

[vars]

An optional table of placeholder names to values. If omited, local variables, upvalues and globals will be used for resolution.

Return value

Returns the parsed Lua value or table of documents. On error, returns nil and an error message string.

Example

--! luart-extensions import yaml local data, err = yaml.load("config.yaml") if data then print(data.setting) else print("Error:", err) end