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