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.
var srvHandler http.Handler // Handler to serve your HTML
var log *slog.Logger // Your slog logger
srvHandler, err = reload.NewMiddleware(
// Pass in the old HTML handler.
srvHandler,
// Pass in the directory you want to watch.
// When a file in this directory changes, the browser will reload.
serveDir,
// Optionally, pass in a logger to be notified of detected file changes.
log,
)
if err != nil {
return fmt.Errorf("failed to create reload middleware: %w", err)
}
Script is the JavaScript snippet that enables auto-reloading in the browser.
Embed this into your index.html or equivalent.
Heavily inspired by https://github.com/aarol/reload, licensed under MIT.