Skip to content

YAML Converter

Add this converter to read yaml files as json.

sh
npm add @loom-io/yaml-converter
sh
pnpm add @loom-io/yaml-converter
sh
bun add @loom-io/yaml-converter

Usage

You can read and write yaml files with the suffixes yaml adn yml.

ts
import { createYamlConverter } from "@loom-io/yaml-converter";

const yamlFile = adapter.file("some/yaml/file.yaml");
const converter = createJsonConverter();
const data = await converter.parse(yamlFile);
data.val = "test";
await converter.unify(yamlFile, data);