@layerfig/parser-yaml
v6.0.1
Published
Source parser for .yaml and .yml config files
Downloads
133
Maintainers
Readme
@layerfig/parser-yaml
Load .yaml or .yml configuration within @layerfig/config.
Getting started
Install the parser:
npm add @layerfig/parser-yamlDefine it in the layerfig config:
import { ConfigBuilder } from "@layerfig/config";
import { FileSource } from "@layerfig/config/sources/file";
import yamlParser from "@layerfig/parser-yaml";
import { schema } from "./schema";
const config = new ConfigBuilder({
validate: (fullConfig) => schema.parse(fullConfig),
parser: yamlParser,
})
.addSource(new FileSource("base.yaml"))
.addSource(new FileSource("live.yml"))
.build();