Companion

Functions

Link copied to clipboard

Reads the file at path. Throws if it cannot be read, as in browsers, which have no file system; use fromString there.

Link copied to clipboard
fun fromResource(path: String, optional: Boolean = false): YamlSource

Reads a bundled file (see readResourceText for each platform); optional allows it to be missing.

Link copied to clipboard
fun fromString(content: String, origin: String? = null): YamlSource

Parses YAML text that is already in memory. Blank text, or text with only comments, gives an empty source. origin, such as the file name, labels the source in ConfigLoader.explain reports.