{"id":15097598,"url":"https://github.com/unfor19/yarser","last_synced_at":"2025-04-14T23:08:59.461Z","repository":{"id":57692176,"uuid":"392823176","full_name":"unfor19/yarser","owner":"unfor19","description":"A CLI for parsing YAML anchors to regular YAML files.","archived":false,"fork":false,"pushed_at":"2021-09-13T18:06:20.000Z","size":49,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-14T23:08:49.674Z","etag":null,"topics":["anchor","parse","parser","parsing","yaml","yml"],"latest_commit_sha":null,"homepage":"https://meirg.co.il","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unfor19.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-04T20:59:17.000Z","updated_at":"2024-05-31T17:11:57.000Z","dependencies_parsed_at":"2022-09-26T20:52:54.502Z","dependency_job_id":null,"html_url":"https://github.com/unfor19/yarser","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unfor19%2Fyarser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unfor19%2Fyarser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unfor19%2Fyarser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unfor19%2Fyarser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unfor19","download_url":"https://codeload.github.com/unfor19/yarser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248975315,"owners_count":21192210,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anchor","parse","parser","parsing","yaml","yml"],"created_at":"2024-09-25T16:23:51.878Z","updated_at":"2025-04-14T23:08:59.443Z","avatar_url":"https://github.com/unfor19.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# yarser\n\n[![Release](https://github.com/unfor19/yarser/actions/workflows/release.yml/badge.svg)](https://github.com/unfor19/yarser/actions/workflows/release.yml)\n\nA CLI for parsing YAML anchors to plain YAML files.\n\n![yarser-demo](https://assets.meirg.co.il/yarser/yarser-demo.gif)\n\n## Features\n\n- Parses YAML anchors\n- Allows usage of `.hidden` nodes by adding the prefix `.` to a root node. All hidden nodes are omitted from the final result\n\nIn my tests, I use [tests/github-action/my-action.yml](https://github.com/unfor19/yarser/blob/master/tests/github-action/my-action.yml) as the source file, and the compiled result is [tests/github-action/my-action-compiled.yml](https://github.com/unfor19/yarser/blob/master/tests/github-action/my-action-compiled.yml). Go ahead and check how it looks like after parsing (compiling) the source YAML file.\n\n## Getting Started\n\n1. Download the binary file from the releases page, for example [0.0.1rc3](https://github.com/unfor19/yarser/releases/tag/0.0.1rc3)\n   - macOS - Intel chips\n    ```bash\n    YARSER_OS=\"darwin\" \u0026\u0026 \\\n    YARSER_ARCH=\"amd64\" \u0026\u0026 \\\n    YARSER_VERSION=\"0.0.1rc3\" \u0026\u0026 \\\n    curl -sL -o yarser \"https://github.com/unfor19/yarser/releases/download/${YARSER_VERSION}/yarser_${YARSER_VERSION}_${YARSER_OS}_${YARSER_ARCH}\"\n    ```\n   - macOS - M1 chips\n    ```bash\n    YARSER_OS=\"darwin\" \u0026\u0026 \\\n    YARSER_ARCH=\"arm64\" \u0026\u0026 \\\n    YARSER_VERSION=\"0.0.1rc3\" \u0026\u0026 \\\n    curl -sL -o yarser \"https://github.com/unfor19/yarser/releases/download/${YARSER_VERSION}/yarser_${YARSER_VERSION}_${YARSER_OS}_${YARSER_ARCH}\"\n    ```    \n   - Linux - amd64\n    ```bash\n    YARSER_OS=\"linux\" \u0026\u0026 \\\n    YARSER_ARCH=\"amd64\" \u0026\u0026 \\\n    YARSER_VERSION=\"0.0.1rc3\" \u0026\u0026 \\\n    curl -sL -o yarser \"https://github.com/unfor19/yarser/releases/download/${YARSER_VERSION}/yarser_${YARSER_VERSION}_${YARSER_OS}_${YARSER_ARCH}\"\n    ```\n   - [Windows WSL2](https://docs.microsoft.com/en-us/windows/wsl/install-win10) - 386\n    ```bash\n    YARSER_OS=\"linux\" \u0026\u0026 \\\n    YARSER_ARCH=\"386\" \u0026\u0026 \\    \n    YARSER_VERSION=\"0.0.1rc3\" \u0026\u0026 \\\n    curl -sL -o yarser \"https://github.com/unfor19/yarser/releases/download/${YARSER_VERSION}/yarser_${YARSER_VERSION}_${YARSER_OS}_${YARSER_ARCH}\"   \n    ```\n2. Set permissions to allow execution of `yarser` binary and move to `/usr/local/bin` dir \n   ```bash\n   chmod +x yarser \u0026\u0026 \\\n   sudo mv yarser \"/usr/local/bin/yarser\"\n   ```\n3. Parse a YAML file once - here's the YAML file with anchors that I'm testing with [my-action.yml](tests/github-action/my-action.yml)\n   ```bash\n   SRC_FILE_PATH=\"tests/github-action/my-action.yml\" \u0026\u0026 \\\n   DST_FILE_PATH=\".my-action-compiled.yml\" \u0026\u0026 \\\n   yarser parse --watch \"$SRC_FILE_PATH\" \"$DST_FILE_PATH\"\n   # INFO[2021-08-21T19:10:25+03:00] Successfully parsed tests/github-action/my-action.yml to .my-action-compiled.yml\n   # Check the file .my-action-compiled.yml\n   ```\n4. Parse on save while editing the source file by adding the `--watch` flag\n   ```bash\n   SRC_FILE_PATH=\"tests/github-action/my-action.yml\" \u0026\u0026 \\\n   DST_FILE_PATH=\".my-action-compiled.yml\" \u0026\u0026 \\\n   yarser parse --watch \"$SRC_FILE_PATH\" \"$DST_FILE_PATH\"\n   \n   # INFO[2021-08-21T19:13:47+03:00] Watching for changes in tests/github-action/my-action.yml ... \n   # INFO[2021-08-21T19:13:53+03:00] Successfully parsed tests/github-action/my-action.yml to .my-action-compiled.yml\n   \n   # Keep on editing and saving the source file, and it will automatically parse it\n   ```\n\n## Authors\n\nCreated and maintained by [Meir Gabay](https://github.com/unfor19)\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/unfor19/yarser/blob/master/LICENSE) file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funfor19%2Fyarser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funfor19%2Fyarser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funfor19%2Fyarser/lists"}