{"id":16334552,"url":"https://github.com/pta2002/gleam-radiate","last_synced_at":"2026-01-23T22:09:15.854Z","repository":{"id":202782079,"uuid":"708150003","full_name":"pta2002/gleam-radiate","owner":"pta2002","description":"Hot code reloading for Gleam","archived":false,"fork":false,"pushed_at":"2025-09-18T10:34:06.000Z","size":33,"stargazers_count":56,"open_issues_count":3,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-18T12:41:38.507Z","etag":null,"topics":["gleam"],"latest_commit_sha":null,"homepage":"","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/pta2002.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-10-21T17:10:26.000Z","updated_at":"2025-09-18T10:34:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"11e797aa-e386-40c6-95c4-fe67f7a7edb5","html_url":"https://github.com/pta2002/gleam-radiate","commit_stats":null,"previous_names":["pta2002/gleam-radiate"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/pta2002/gleam-radiate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pta2002%2Fgleam-radiate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pta2002%2Fgleam-radiate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pta2002%2Fgleam-radiate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pta2002%2Fgleam-radiate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pta2002","download_url":"https://codeload.github.com/pta2002/gleam-radiate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pta2002%2Fgleam-radiate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28701020,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T17:25:48.045Z","status":"ssl_error","status_checked_at":"2026-01-23T17:25:47.153Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["gleam"],"created_at":"2024-10-10T23:38:44.167Z","updated_at":"2026-01-23T22:09:15.837Z","avatar_url":"https://github.com/pta2002.png","language":"Gleam","funding_links":[],"categories":[],"sub_categories":[],"readme":"# radiate\n\n[![Package Version](https://img.shields.io/hexpm/v/radiate)](https://hex.pm/packages/radiate)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/radiate/)\n\nHot reloading while in development for Gleam!\n\n## Introduction\n\nRadiate will watch any directory you specify for changes. When a file is\nchanged in that directory, it'll check if it's a Gleam file, and if it is, the\nproject will be recompiled and all modified modules will be reloaded, without\nhaving to restart the BEAM VM.\n\n## Quick start\n\n```gleam\n// On main.gleam\nimport gleam/erlang/process\nimport gleam/io\nimport radiate\nimport message\n\npub fn main() {\n  let _ =\n    radiate.new()\n    |\u003e radiate.add_dir(\"src\")\n    |\u003e radiate.start()\n\n  let timer_subject = process.new_subject()\n\n  print_every_second(timer_subject)\n}\n\nfn print_every_second(subject: process.Subject(Nil)) {\n  process.send_after(subject, 1000, Nil)\n\n  let _ = process.receive(subject, 1500)\n  io.println(message.get_message())\n\n  print_every_second(subject)\n}\n\n// On message.gleam\npub fn get_message() -\u003e String {\n  \"Hello!\"\n}\n```\n\nWhen you first run this, it'll print \"Hello!\" every second.\n\nNow, go ahead and change the text `get_message` returns to `\"Hello, world!\"`, and save the file.\n\nAs soon as you save, the message printed is changed to \"Hello, world!\", without needing to restart the program!\n\n### Warning for macOS users\n\nRight now, the `add_dir` function only supports `\".\"` or an absolute path! Be careful to resolve the path to get it work if you want to watch `\"src\"` for example.\n\n## Adding a callback\n\nYou can add callbacks to be run every time code is reloaded through `on_reload`:\n\n```gleam\nimport radiate\nimport gleam/io\n\npub fn main() {\n  let _ = radiate.new()\n    |\u003e radiate.add_dir(\"src\")\n    |\u003e radiate.on_reload(fn (_state, path) {\n      io.println(\"Change in \" \u003c\u003e path \u003c\u003e \", reloading!\")\n    })\n    |\u003e radiate.start()\n}\n```\n\n\n## Installation\n\nThis package can be added to your Gleam project:\n\n```sh\ngleam add radiate\n```\n\nand its documentation can be found at \u003chttps://hexdocs.pm/radiate\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpta2002%2Fgleam-radiate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpta2002%2Fgleam-radiate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpta2002%2Fgleam-radiate/lists"}