| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
😋 A stupid simple YAML Parser.
From YAML to stringified JSON, JsonNode or Nim objects via pkg/jsony
nimble install nyml
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
let contents = readFile("sample.yaml")
let jsonContents: JsonNode = yaml(contents).toJson.getlet osName: JsonNode = yaml(contents).toJson.get("jobs.test.runs-on")
echo osName.getStrlet example = """
name: ${{username}}
"""
let yml = yaml(example, data = %*{"username": "John Do The Do"})
echo yml # {"name": "John Do The Do"}echo yaml(contents)
# dump to json with indentation
echo yaml(contents, true)
MIT license. Made by Humans from OpenPeeps.
Copyright © 2023 OpenPeeps & Contributors — All rights reserved.
| Back | FazBrowse Home | New Git URL |