SkillAgentSearch skills...

Nyml

A stupid simple YAML Parser. From YAML to stringified JSON, JsonNode or Nim objects. Written in Nim language ๐Ÿ‘‘

Install / Use

/learn @openpeeps/Nyml
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

<p align="center"> ๐Ÿ˜‹ A stupid simple YAML Parser.<br>From <code>YAML</code> to stringified <code>JSON</code>, <code>JsonNode</code> or <code>Nim</code> objects via <code>pkg/jsony</code><br> </p> <p align="center"> <code>nimble install nyml</code> </p> <p align="center"> <a href="https://openpeeps.github.io/nyml/">API reference</a><br><br> <img src="https://github.com/openpeeps/nyml/workflows/test/badge.svg" alt="Github Actions"> <img src="https://github.com/openpeeps/nyml/workflows/docs/badge.svg" alt="Github Actions"> </p>

๐Ÿ˜ Key Features

  • [x] integer, string, boolean, array, object
  • [x] GET access using dot annotations
  • [x] Direct to object parser using JSONY
  • [x] Rules and Validator
  • [x] Open Source | MIT License

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

๐ŸŽฉ License

MIT license. Made by Humans from OpenPeeps.<br> Copyright ยฉ 2023 OpenPeeps & Contributors โ€” All rights reserved.

Related Skills

View on GitHub
GitHub Stars20
CategoryDevelopment
Updated1mo ago
Forks3

Languages

Nim

Security Score

95/100

Audited on Mar 9, 2026

No findings