{"id":13741626,"url":"https://github.com/giacomocavalieri/glam","last_synced_at":"2025-04-01T14:24:51.984Z","repository":{"id":189953086,"uuid":"681364829","full_name":"giacomocavalieri/glam","owner":"giacomocavalieri","description":"✨ A package to help you easily pretty print structured data","archived":false,"fork":false,"pushed_at":"2025-02-11T09:53:17.000Z","size":1933,"stargazers_count":38,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-28T17:00:00.622Z","etag":null,"topics":["pretty-printer"],"latest_commit_sha":null,"homepage":"https://hexdocs.pm/glam/","language":"Gleam","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/giacomocavalieri.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":"2023-08-21T21:19:59.000Z","updated_at":"2025-02-11T17:15:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"a6620952-ec0d-40dc-8879-7db7af8cf176","html_url":"https://github.com/giacomocavalieri/glam","commit_stats":null,"previous_names":["giacomocavalieri/glam"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giacomocavalieri%2Fglam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giacomocavalieri%2Fglam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giacomocavalieri%2Fglam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giacomocavalieri%2Fglam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/giacomocavalieri","download_url":"https://codeload.github.com/giacomocavalieri/glam/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246652770,"owners_count":20812187,"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":["pretty-printer"],"created_at":"2024-08-03T04:01:01.080Z","updated_at":"2025-04-01T14:24:51.969Z","avatar_url":"https://github.com/giacomocavalieri.png","language":"Gleam","funding_links":[],"categories":["Packages","Gleam"],"sub_categories":["Text"],"readme":"![Glam](https://github.com/giacomocavalieri/glam/blob/main/resources/glam_banner.png?raw=true)\n\n[![Package Version](https://img.shields.io/hexpm/v/glam?color=92DCE5)](https://hex.pm/packages/glam)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3?color=FCC0D2)](https://hexdocs.pm/glam/)\n\n✨ A package to help you easily pretty print structured data\n\n\u003e ⚙️ This package works with both the Erlang and Javascript target\n\n## Installation\n\nTo add this package to your Gleam project:\n\n```sh\ngleam add glam\n```\n\n## Pretty printing\n\nWhen working with structured data (like JSON, XML, lists, ASTs, ...) it can\nbe useful to print it in a nice and tidy way.\nOf course, one could go the quick and dirty way and just `string.inspect`\nthe data structure and call it a day.\nHowever, the result would hardly be readable for complex data structures.\n\nOn the other hand, handwriting a pretty printing function can be quite\ndifficult (I sure have spent my fair share of time writing those) and\nerror-prone: there are a lot of moving pieces to juggle and it's easy for bugs\nto sneak in.\n\nA pretty printing package like Glam provides some basic building blocks to\n_describe_ the structure of your data and takes care of the heavy lifting of\nactually finding the best layout to format the data, gracefully handling line\nlimits and indentation.\n\n## Getting started\n\nIf you want to get started with Glam, a great starting point is the\n[learning materials page](https://hexdocs.pm/glam/learning_materials.html)!\nThere you'll find a lot of step-by-step tutorials that will guide you through\nsome awesome pretty printers and get you up and running with Glam.\n\nBy the end of the tutorials you'll know most of the package's API and you'll\nhave implemented pretty printers for lists, JSON and error messages:\n\n```gleam\npretty_list([\"Gleam\", \"is\", \"fun!\"])\n|\u003e doc.to_string(10) // Fit the list on lines of width 10\n\n// [\n//   \"Gleam\",\n//   \"is\",\n//   \"fun!\",\n// ]\n```\n\nYou can also have a look at the\n[`examples`](https://github.com/giacomocavalieri/glam/tree/main/test/glam/examples)\nfolder in the GitHub repo, there you'll also find a JSON pretty printer.\n\n## Contributing\n\nIf you think there's any way to improve this package, or if you spot a bug\ndon't be afraid to open PRs, issues or requests of any kind!\nAny contribution is welcome 💜\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiacomocavalieri%2Fglam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgiacomocavalieri%2Fglam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiacomocavalieri%2Fglam/lists"}