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 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
⌂ 换网址