{"id":13524533,"url":"https://github.com/rxi/lurker","last_synced_at":"2025-04-07T05:13:31.615Z","repository":{"id":14734056,"uuid":"17454896","full_name":"rxi/lurker","owner":"rxi","description":"Auto-swaps changed Lua files in a running LÖVE project","archived":false,"fork":false,"pushed_at":"2023-07-22T23:29:56.000Z","size":18,"stargazers_count":316,"open_issues_count":7,"forks_count":28,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-03-31T04:07:52.148Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/rxi.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}},"created_at":"2014-03-05T20:52:38.000Z","updated_at":"2025-03-28T11:25:19.000Z","dependencies_parsed_at":"2024-01-08T20:19:18.418Z","dependency_job_id":null,"html_url":"https://github.com/rxi/lurker","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rxi%2Flurker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rxi%2Flurker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rxi%2Flurker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rxi%2Flurker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rxi","download_url":"https://codeload.github.com/rxi/lurker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247595335,"owners_count":20963943,"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-08-01T06:01:11.003Z","updated_at":"2025-04-07T05:13:31.597Z","avatar_url":"https://github.com/rxi.png","language":"Lua","funding_links":[],"categories":["资源","Lua","Resources","Development"],"sub_categories":["Game Development"],"readme":"# Lurker\n\nA small module which automatically hotswaps changed Lua files in a running\n[LÖVE](http://love2d.org) project.\n\n\n## Installation\n\nDrop the [lurker.lua](lurker.lua?raw=1) and\n[lume.lua](https://raw.github.com/rxi/lume/master/lume.lua) files into an\nexisting project and add the following line inside the `love.update()`\nfunction:\n```lua\nrequire(\"lurker\").update()\n```\nLurker will automatically detect changed files and hotswap them into the\nrunning project.\n\n\n## Additional Functionality\n\nTo more easily make use of additional functionality, the lurker module can be\nset to a variable when it is required into the project:\n```lua\nlurker = require \"lurker\"\n```\n\n### lurker.scan()\nAs opposed to using the `lurker.update()` function -- such to avoid the\noverhead of repeatedly polling for file changes -- you can instead opt to\ntrigger a scan of the directory by calling `lurker.scan()` manually. If the\nscan detects any changes a hotswap is performed.\n\n### lurker.preswap\n`lurker.preswap` can be set to a function. This function is called before a\nhotswap occurs and is passed the name of the file which will be swapped. If the\nfunction returns `true` then the hotswap is canceled.\n```lua\nlurker.preswap = function(f) print(\"File \" .. f .. \" swapping...\") end\n```\n\n### lurker.postswap\n`lurker.postswap` can be set to a function. This function is called after a\nhotswap occurs and is passed the name of the file which was swapped.\n```lua\nlurker.postswap = function(f) print(\"File \" .. f .. \" was swapped\") end\n```\n\n### lurker.protected\nDictates whether lurker should run in protected mode; this is `true` by\ndefault. If protected mode is disabled then LÖVE's usual error screen is used\nwhen an error occurs in a LÖVE callback function; if it is enabled then\nlurker's error state (which continues watching for file changes and can resume\nexecution) is used. Changes to this variable should be made before any calls to\nlurker.update() are made.\n\n### lurker.quiet\nDictates what should happen if lurker tries to load a file which contains a\nsyntax error. If it is `false` then lurker's error screen is shown until the\nsyntax error is fixed; if it is `true` the error message is printed to the\nconsole and the program continues. lurker.quiet is `false` by default.\n\n### lurker.interval\nThe interval in seconds for how often the scan of the directory is performed.\nThis is `.5` by default.\n\n### lurker.path\nThe directory which is scanned for changes. This is `.` (The project's root) by\ndefault.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frxi%2Flurker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frxi%2Flurker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frxi%2Flurker/lists"}