Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jupegarnica/garn-yaml
read or write yaml interpolating env variables
https://github.com/jupegarnica/garn-yaml
Last synced: 18 days ago
JSON representation
read or write yaml interpolating env variables
- Host: GitHub
- URL: https://github.com/jupegarnica/garn-yaml
- Owner: jupegarnica
- Created: 2020-12-04T10:27:49.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-03-11T08:23:31.000Z (almost 4 years ago)
- Last Synced: 2024-11-18T16:57:31.851Z (25 days ago)
- Language: TypeScript
- Homepage: https://deno.land/x/garn_yaml
- Size: 13.7 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-deno - garn-yaml - Read or write yaml interpolating env variables. (Modules / Utils)
README
gar-yaml: read or write yaml interpolating env variables
[deno.land/x/garn-yaml](https://deno.land/x/garn_yaml)
![Test](https://github.com/jupegarnica/garn-yaml/workflows/Test/badge.svg)
Usage
```yaml
# read.yml
DENO_ENV: ${{DENO_ENV}}
``````ts
// read.ts
import { readYaml } from 'https://deno.land/x/[email protected]/mod.ts';
import { assertEquals } from 'https://deno.land/[email protected]/testing/asserts.ts';const yamlObject = await readYaml('./read.yml');
assertEquals(typeof yamlObject, 'object');
assertEquals(yamlObject.DENO_ENV, 'development');
``````bash
DENO_ENV=development deno run read.ts --allow-read --allow-env
``````ts
// write.ts
import { writeYaml } from 'https://deno.land/x/[email protected]/mod.ts';const yamlText = await writeYaml('./write.yml', { a: 1 }); // a: 1
``````yaml
# write.yml
a: 1
```