{"id":24927013,"url":"https://github.com/alexei-sintotski/json2yaml","last_synced_at":"2025-07-10T01:04:01.606Z","repository":{"id":36466120,"uuid":"225948354","full_name":"alexei-sintotski/json2yaml","owner":"alexei-sintotski","description":"Dart package to render JSON data to YAML","archived":false,"fork":false,"pushed_at":"2023-07-23T21:43:00.000Z","size":44,"stargazers_count":16,"open_issues_count":9,"forks_count":11,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-22T16:40:55.638Z","etag":null,"topics":["dart","flutter","json","yaml"],"latest_commit_sha":null,"homepage":null,"language":"Dart","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/alexei-sintotski.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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":"2019-12-04T20:10:15.000Z","updated_at":"2024-08-18T08:01:42.000Z","dependencies_parsed_at":"2024-06-19T09:55:42.729Z","dependency_job_id":"2f0723f4-ac7f-456b-ac7b-e5b026786daf","html_url":"https://github.com/alexei-sintotski/json2yaml","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/alexei-sintotski/json2yaml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexei-sintotski%2Fjson2yaml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexei-sintotski%2Fjson2yaml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexei-sintotski%2Fjson2yaml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexei-sintotski%2Fjson2yaml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexei-sintotski","download_url":"https://codeload.github.com/alexei-sintotski/json2yaml/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexei-sintotski%2Fjson2yaml/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264506779,"owners_count":23619063,"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":["dart","flutter","json","yaml"],"created_at":"2025-02-02T12:54:11.570Z","updated_at":"2025-07-10T01:04:01.444Z","avatar_url":"https://github.com/alexei-sintotski.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# json2yaml ![Build Status](https://github.com/alexei-sintotski/json2yaml/actions/workflows/dart.yml/badge.svg?branch=master) [![pubspec_lock version](https://img.shields.io/pub/v/json2yaml?label=json2yaml)](https://pub.dev/packages/json2yaml)\n\nDart package to render JSON data to YAML:\n* Correct handling of nested structures\n* Built-in automatic beautifer\n* Supports Dart pubspec.yaml conventions\n* Compatible with conventions imposed by Dart pubspec.lock generator\n\n## Known limitations\n\n* Strings (single line and multiline) are always formatted as they are,\nwithout word wrapping for better human readability\n\n## json2yaml()\n\njson2yaml is the function to format JSON data to YAML.\n\n```\n  const developerData = {\n    'name': \"Martin D'vloper\",\n    'job': 'Developer',\n    'skill': 'Elite',\n    'employed': true,\n    'foods': ['Apple', 'Orange', 'Strawberry', 'Mango'],\n    'languages': {\n      'perl': 'Elite',\n      'python': 'Elite',\n      'pascal': 'Lame',\n    },\n    'education': '4 GCSEs\\n3 A-Levels\\nBSc in the Internet of Things'\n  };\n\n  print(json2yaml(developerData));\n```\n\n## Advanced usage: YAML formatting styles\n\njson2yaml supports the optional argument to customize YAML formatting for various use cases.\nAt the moment, it supports the three following formatting styles:\n- YamlStyle.generic (default) -- Default formatting style applicable in most cases\n- YamlStyle.pubspecYaml -- YAML formatting style following pubspec.yaml formatting conventions\n- YamlStyle.pubspecLock -- YAML formatting style following pubspec.lock formatting conventions\n\nYAML style is supplied as an optional argument to json2yaml():\n\n```\n/// Yaml formatting control options\nenum YamlStyle {\n  generic,\n  pubspecYaml,\n  pubspecLock,\n}\n\n/// Converts JSON to YAML representation\nString json2yaml(\n  Map\u003cString, dynamic\u003e json, {\n  YamlStyle yamlStyle = YamlStyle.generic,\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexei-sintotski%2Fjson2yaml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexei-sintotski%2Fjson2yaml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexei-sintotski%2Fjson2yaml/lists"}