Skip to content

jupegarnica/garn-yaml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gar-yaml: read or write yaml interpolating env variables

deno.land/x/garn-yaml

Test

Usage

# read.yml
DENO_ENV: ${{DENO_ENV}}
// read.ts
import { readYaml } from 'https://deno.land/x/garn_yaml@0.2.1/mod.ts';
import { assertEquals } from 'https://deno.land/std@0.90.0/testing/asserts.ts';

const yamlObject = await readYaml('./read.yml');
assertEquals(typeof yamlObject, 'object');
assertEquals(yamlObject.DENO_ENV, 'development');
DENO_ENV=development deno run read.ts --allow-read --allow-env
// write.ts
import { writeYaml } from 'https://deno.land/x/garn_yaml@0.2.1/mod.ts';

const yamlText = await writeYaml('./write.yml', { a: 1 }); // a: 1
# write.yml
a: 1

About

read or write yaml interpolating env variables

Resources

Stars

Watchers

Forks

Packages

No packages published