nyml
Stupid simple YAML-like implementation from YAML to JsonNode
Summary
| Latest Version | Unknown |
|---|---|
| License | MIT |
| CI Status | Failing |
| Downloads | 0 |
| Last Indexed | 2026-07-21 05:25 |
Tags
Installation
nimble install nyml
choosenim install nyml
git clone https://github.com/openpeeps/nyml
OS Compatibility
| Platform | Linux | macOS | Windows | FreeBSD | OpenBSD | NetBSD | Android | iOS | WASM | Embedded |
|---|---|---|---|---|---|---|---|---|---|---|
| nyml | ✓ | ✓ | ✓ | - | - | - | - | - | - | - |
Source
| Repository | https://github.com/openpeeps/nyml |
|---|---|
| Homepage | https://github.com/openpeeps/nyml |
| Registry Source | nimble_official |
README
😋 A stupid simple YAML Parser.
From YAML to stringified JSON, JsonNode or Nim objects via pkg/jsony
nimble install nyml
😍 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
A simple YAML file
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
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.
Copyright © 2023 OpenPeeps & Contributors — All rights reserved.