@model-w/hydroyaml
v1.0.0
Published
A YAML templating engine
Downloads
1
Readme
Hydroyaml — The YAML of the gods
Hydroyaml is a templating engine for YAML files. It is kind of inspired by what Ansible allows you to do, but implemented in Node with powering GitHub Actions in mind.
For example you can have a YAML file like this:
services:
foo: # my foo service
image:
"my-registry.com/{{ .foo.project }}/{{ .foo.name }}:{{ .foo.tag }}"
environment:
DOCKER_IMAGE: "{{ services.foo.image }}"
Then you do this:
import hydroyaml, { fromFile } from "hydroyaml";
const rendered = await hydroyaml(fromFile("my-template.yml"), {
foo: {
project: "my-project",
name: "my-service",
tag: "latest",
},
});
And rendered
will contain:
services:
foo: # my foo service
image: my-registry.com/my-project/my-service:latest
environment:
DOCKER_IMAGE: my-registry.com/my-project/my-service:latest