ProductPromotion
Logo

Lua

made by https://0x3d.site

GitHub - rxi/lurker: Auto-swaps changed Lua files in a running LÖVE project
Auto-swaps changed Lua files in a running LÖVE project - rxi/lurker
Visit Site

GitHub - rxi/lurker: Auto-swaps changed Lua files in a running LÖVE project

GitHub - rxi/lurker: Auto-swaps changed Lua files in a running LÖVE project

Lurker

A small module which automatically hotswaps changed Lua files in a running LÖVE project.

Installation

Drop the lurker.lua and lume.lua files into an existing project and add the following line inside the love.update() function:

require("lurker").update()

Lurker will automatically detect changed files and hotswap them into the running project.

Additional Functionality

To more easily make use of additional functionality, the lurker module can be set to a variable when it is required into the project:

lurker = require "lurker"

lurker.scan()

As opposed to using the lurker.update() function -- such to avoid the overhead of repeatedly polling for file changes -- you can instead opt to trigger a scan of the directory by calling lurker.scan() manually. If the scan detects any changes a hotswap is performed.

lurker.preswap

lurker.preswap can be set to a function. This function is called before a hotswap occurs and is passed the name of the file which will be swapped. If the function returns true then the hotswap is canceled.

lurker.preswap = function(f) print("File " .. f .. " swapping...") end

lurker.postswap

lurker.postswap can be set to a function. This function is called after a hotswap occurs and is passed the name of the file which was swapped.

lurker.postswap = function(f) print("File " .. f .. " was swapped") end

lurker.protected

Dictates whether lurker should run in protected mode; this is true by default. If protected mode is disabled then LÖVE's usual error screen is used when an error occurs in a LÖVE callback function; if it is enabled then lurker's error state (which continues watching for file changes and can resume execution) is used. Changes to this variable should be made before any calls to lurker.update() are made.

lurker.quiet

Dictates what should happen if lurker tries to load a file which contains a syntax error. If it is false then lurker's error screen is shown until the syntax error is fixed; if it is true the error message is printed to the console and the program continues. lurker.quiet is false by default.

lurker.interval

The interval in seconds for how often the scan of the directory is performed. This is .5 by default.

lurker.path

The directory which is scanned for changes. This is . (The project's root) by default.

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory