Nyml
A stupid simple YAML Parser. From YAML to stringified JSON, JsonNode or Nim objects. Written in Nim language ๐
Install / Use
/learn @openpeeps/NymlREADME
๐ Key Features
- [x]
integer,string,boolean,array,object - [x]
GETaccess usingdotannotations - [x] Direct to object parser using JSONY
- [x] Rules and Validator
- [x] Open Source |
MITLicense
Example
<details> <summary>A simple YAML file</summary>name: test
on:
push:
paths-ignore:
- LICENSE
- README.*
pull_request:
paths-ignore:
- LICENSE
- README.*
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
nim-version:
- 'stable'
steps:
- uses: actions/checkout@v2
- uses: jiro4989/setup-nim-action@v1
with:
nim-version: ${{ matrix.nim-version }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: nimble install -Y
- run: nim --threads:on c -r src/tim.nim
- run: nimble test
</details>
Get JSON document
let contents = readFile("sample.yaml")
let jsonContents: JsonNode = yaml(contents).toJson.get
Get a specific value using . notation
let osName: JsonNode = yaml(contents).toJson.get("jobs.test.runs-on")
echo osName.getStr
Handle variables
let example = """
name: ${{username}}
"""
let yml = yaml(example, data = %*{"username": "John Do The Do"})
echo yml # {"name": "John Do The Do"}
Dump YAML to stringified JSON
echo yaml(contents)
# dump to json with indentation
echo yaml(contents, true)
โค Contributions & Support
- ๐ Found a bug? Create a new Issue
- ๐ Wanna help? Fork it!
- ๐ Get โฌ20 in cloud credits from Hetzner
- ๐ฅฐ Donate to OpenPeeps via PayPal address
๐ฉ License
MIT license. Made by Humans from OpenPeeps.<br>
Copyright ยฉ 2023 OpenPeeps & Contributors โ All rights reserved.
Related Skills
node-connect
351.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
351.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
351.8kQQBot ๅฏๅชไฝๆถๅ่ฝๅใไฝฟ็จ <qqmedia> ๆ ็ญพ๏ผ็ณป็ปๆ นๆฎๆไปถๆฉๅฑๅ่ชๅจ่ฏๅซ็ฑปๅ๏ผๅพ็/่ฏญ้ณ/่ง้ข/ๆไปถ๏ผใ
