gluawatch

package module
v0.0.0-...-808150c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2025 License: MIT Imports: 9 Imported by: 0

README

gluawatch

This is a lua module for watch file changes

Usage

Installation
local watch = require("gluawatch")
Example
-- Watch one or more directories for changes
local paths = {"/path/to/watch", "/another/path"}
local delay = 500 -- debounce delay in milliseconds (optional, defaults to 500)

-- Callback function receives the changed file path
local function onChange(filepath)
    print("File changed:", filepath)
end

-- Start watching
watch.watch(paths, onChange, delay)
API Reference
watch.watch(paths, callback[, delay])
  • paths: table of strings - Directories to watch recursively
  • callback: function(filepath) - Called when files change
  • delay: number (optional) - Debounce delay in milliseconds, default 500
Notes

The watcher automatically ignores these directories:

  • .git
  • node_modules
  • vendor
  • pycache

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Loader

func Loader(L *lua.LState) int

Loader is the module loader function for gluawatch

Types

type Debouncer

type Debouncer struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL