{"id":20533064,"url":"https://github.com/refreezed/luahotloader","last_synced_at":"2025-04-14T06:32:31.835Z","repository":{"id":45920869,"uuid":"119102739","full_name":"ReFreezed/LuaHotLoader","owner":"ReFreezed","description":"Lua library for hot-loading files, including modules. Works with LuaFileSystem or LÖVE.","archived":false,"fork":false,"pushed_at":"2022-07-19T02:16:21.000Z","size":85,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T20:14:05.985Z","etag":null,"topics":["hotloader","library","love2d","lua","lua-library","lua-module","lua51","luafilesystem"],"latest_commit_sha":null,"homepage":"http://refreezed.com/luahotloader/","language":"Lua","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/ReFreezed.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog.txt","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-26T21:01:25.000Z","updated_at":"2023-04-09T14:53:08.000Z","dependencies_parsed_at":"2022-09-11T02:22:42.588Z","dependency_job_id":null,"html_url":"https://github.com/ReFreezed/LuaHotLoader","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReFreezed%2FLuaHotLoader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReFreezed%2FLuaHotLoader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReFreezed%2FLuaHotLoader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReFreezed%2FLuaHotLoader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ReFreezed","download_url":"https://codeload.github.com/ReFreezed/LuaHotLoader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248834070,"owners_count":21168951,"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":["hotloader","library","love2d","lua","lua-library","lua-module","lua51","luafilesystem"],"created_at":"2024-11-16T00:18:27.989Z","updated_at":"2025-04-14T06:32:31.796Z","avatar_url":"https://github.com/ReFreezed.png","language":"Lua","readme":"# LuaHotLoader\n\n\u003cp\u003e\n\t\u003ca href=\"https://github.com/ReFreezed/LuaHotLoader/releases/latest\"\u003e\n\t\t\u003cimg src=\"https://img.shields.io/github/release/ReFreezed/LuaHotLoader.svg\" alt=\"\"\u003e\n\t\u003c/a\u003e\n\t\u003ca href=\"https://github.com/ReFreezed/LuaHotLoader/blob/master/LICENSE.txt\"\u003e\n\t\t\u003cimg src=\"https://img.shields.io/github/license/ReFreezed/LuaHotLoader.svg\" alt=\"\"\u003e\n\t\u003c/a\u003e\n\u003c/p\u003e\n\n**LuaHotLoader** is a Lua library for hot-loading files, including modules.\nWorks with *LuaFileSystem* or [*LÖVE*](https://love2d.org/) 0.10+.\n\n- [Basic usage](#basic-usage)\n\t- [With LuaFileSystem](#with-luafilesystem)\n\t- [In LÖVE](#in-lÖve)\n- [Documentation](http://refreezed.com/luahotloader/docs/)\n- [Help](#help)\n\n\n\n## Basic usage\n\n\n### With LuaFileSystem\n\n```lua\nlocal hotLoader = require(\"hotLoader\")\nlocal duckPath  = \"duck.jpg\"\n\n-- Program loop.\nlocal lastTime = os.clock()\n\nwhile true do\n\tlocal currentTime = os.clock()\n\n\t-- Allow the library to reload module and resource files that have been updated.\n\thotLoader.update(currentTime-lastTime)\n\n\t-- Show if debug mode is enabled.\n\tlocal settings = hotLoader.require(\"appSettings\")\n\tif settings.enableDebug then\n\t\tprint(\"DEBUG\")\n\tend\n\n\t-- Show size of duck image.\n\tlocal duckData = hotLoader.load(duckPath)\n\tprint(\"Duck is \"..(#duckData)..\" bytes\")\n\n\tlastTime = currentTime\nend\n```\n\n\n### In LÖVE\n\n```lua\nlocal hotLoader = require(\"hotLoader\")\nlocal player = {\n\tx = 100, y = 50,\n\timagePath = \"player.png\",\n}\n\nfunction love.load()\n\t-- Tell the library to load .png files using love.graphics.newImage().\n\thotLoader.setLoader(\"png\", love.graphics.newImage)\n\n\t-- Note: The library automatically adds common loaders in LÖVE, including\n\t-- for .png files. You can call hotLoader.removeAllLoaders() to undo this.\nend\n\nfunction love.update(dt)\n\t-- Allow the library to reload module and resource files that have been updated.\n\thotLoader.update(dt)\nend\n\nfunction love.draw()\n\t-- Show if debug mode is enabled.\n\tlocal settings = hotLoader.require(\"gameSettings\")\n\tif settings.enableDebug then\n\t\tlove.graphics.print(\"DEBUG\", 5, 5)\n\tend\n\n\t-- Draw player image.\n\tlocal playerImage = hotLoader.load(player.imagePath)\n\tlove.graphics.draw(playerImage, player.x, player.y)\nend\n```\n\n\n\n## Documentation\n\n- [Website](http://refreezed.com/luahotloader/docs/)\n- [The source code](hotLoader.lua)\n\n\n\n## Help\n\nGot a question?\nIf the [documentation](http://refreezed.com/luahotloader/docs/) doesn't have the answer,\nlook if someone has asked the question in the [issue tracker](https://github.com/ReFreezed/LuaHotLoader/issues?q=is%3Aissue),\nor [create a new issue](https://github.com/ReFreezed/LuaHotLoader/issues/new).\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frefreezed%2Fluahotloader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frefreezed%2Fluahotloader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frefreezed%2Fluahotloader/lists"}