{"id":15981207,"url":"https://github.com/drwpow/yaml-to-momoa","last_synced_at":"2025-03-17T22:31:29.059Z","repository":{"id":252554242,"uuid":"840765321","full_name":"drwpow/yaml-to-momoa","owner":"drwpow","description":"Convert a YAML file to Momoa JSON AST","archived":false,"fork":false,"pushed_at":"2025-02-07T19:36:18.000Z","size":205,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-08T14:03:33.914Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/drwpow.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-10T16:05:53.000Z","updated_at":"2025-02-07T19:36:01.000Z","dependencies_parsed_at":"2025-02-07T20:35:04.874Z","dependency_job_id":null,"html_url":"https://github.com/drwpow/yaml-to-momoa","commit_stats":null,"previous_names":["drwpow/yaml-to-momoa"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drwpow%2Fyaml-to-momoa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drwpow%2Fyaml-to-momoa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drwpow%2Fyaml-to-momoa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drwpow%2Fyaml-to-momoa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drwpow","download_url":"https://codeload.github.com/drwpow/yaml-to-momoa/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243891790,"owners_count":20364598,"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":[],"created_at":"2024-10-08T00:42:04.963Z","updated_at":"2025-03-17T22:31:28.761Z","avatar_url":"https://github.com/drwpow.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# yaml-to-momoa\n\nConvert YAML to a [Momoa JSON AST](https://www.npmjs.com/package/@humanwhocodes/momoa). Powered by [yaml](https://eemeli.org/yaml).\n\n## Setup\n\n```sh\nnpm i -D yaml-to-momoa\n```\n\n```ts\nimport yamlToMomoa from \"yaml-to-momoa\";\n\nconst yaml = `object:\n  property:\n    foo: bar\n    bar: 42`;\n\nconst ast = yamlToMomoa(yaml);\n\nconsole.log(ast); // DocumentNode\n```\n\nYou can then traverse the AST just like a Momoa node.\n\n## FAQ\n\n#### Why would I need this?\n\nIf you have some project using JSON and you’re using Momoa, and want to add YAML support. If you aren’t using Momoa, you don’t need this.\n\n#### Can this convert Momoa AST to YAML AST?\n\nNo.\n\n## Gotchas\n\n- This preserves original locations (lines and columns) as best it can, but since YAML ↔ JSON syntax isn’t 1:1, this will result in “impossible” locations (the lines and columns won’t ever match up to any JSON source, since they came from YAML).\n- Since `yaml` is doing the parsing, all YAML features are supported, but superset features have to make some concessions to map to a JSON structure. For example, references (`\u0026[id]`) will all get expanded as if they were duplicated in the original file.\n  - Situations like this will lead to some interesting sourcemap locations, to the first point\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrwpow%2Fyaml-to-momoa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrwpow%2Fyaml-to-momoa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrwpow%2Fyaml-to-momoa/lists"}