[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-76108":3},{"id":4,"name":5,"fullName":6,"owner":5,"repo":5,"description":7,"homepage":8,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":15,"stars7d":15,"stars30d":16,"stars90d":14,"forks30d":14,"starsTrendScore":17,"compositeScore":18,"rankGlobal":9,"rankLanguage":9,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":9,"pushedAt":9,"updatedAt":33,"readmeContent":34,"aiSummary":35,"trendingCount":14,"starSnapshotCount":14,"syncStatus":36,"lastSyncTime":37,"discoverSource":38},76108,"fswatcher","fswatcher\u002Ffswatcher","Cross-platform file system notifications for Go.","",null,"Go",221,10,4,0,1,25,3,3.12,"MIT License",false,"main",true,[24,25,26,27,28,29,30,31,32],"file-watcher","filesystem","fsnotify","go","gofsnotify","golang","inotify","kqueue","readdirectorychangesw","2026-06-12 02:03:40","# fswatcher\n\n[![CI](https:\u002F\u002Fgithub.com\u002Ffswatcher\u002Ffswatcher\u002Factions\u002Fworkflows\u002Fci.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Ffswatcher\u002Ffswatcher\u002Factions\u002Fworkflows\u002Fci.yml)\n[![Go Reference](https:\u002F\u002Fpkg.go.dev\u002Fbadge\u002Fgithub.com\u002Ffswatcher\u002Ffswatcher.svg)](https:\u002F\u002Fpkg.go.dev\u002Fgithub.com\u002Ffswatcher\u002Ffswatcher)\n\nCross-platform file system notifications for Go.\n\n> Previously published as `github.com\u002Fgofsnotify\u002Ffsnotify` (package `fsnotify`). The old path is deprecated and redirects here; update imports and rename `fsnotify.X` to `fswatcher.X`. See [#27](https:\u002F\u002Fgithub.com\u002Ffswatcher\u002Ffswatcher\u002Fissues\u002F27).\n\n## Install\n\n```\ngo get github.com\u002Ffswatcher\u002Ffswatcher\n```\n\n## Usage\n\n```go\npackage main\n\nimport (\n\t\"log\"\n\n\t\"github.com\u002Ffswatcher\u002Ffswatcher\"\n)\n\nfunc main() {\n\tw, err := fswatcher.NewWatcher()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer w.Close()\n\n\tif err := w.Add(\"\u002Fpath\u002Fto\u002Fdir\", fswatcher.Create|fswatcher.Write|fswatcher.Remove); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tfor {\n\t\tselect {\n\t\tcase ev := \u003C-w.Events:\n\t\t\tlog.Println(ev)\n\t\tcase err := \u003C-w.Errors:\n\t\t\tlog.Println(\"error:\", err)\n\t\t}\n\t}\n}\n```\n\n## API\n\n- `NewWatcher() (*Watcher, error)` — creates a watcher.\n- `(*Watcher).Add(path string, op Op) error` — registers `path` with the given event mask. Returns `ErrAlreadyAdded` if `path` is already registered.\n- `(*Watcher).AddRecursive(path string, op Op) error` — registers `path` and every directory under it. New subdirectories created inside are watched automatically; removed subdirectories are dropped. `Remove` may only be called on the original recursive root.\n- `(*Watcher).Remove(path string) error` — unregisters `path`. For an `AddRecursive` registration this drops the entire subtree.\n- `(*Watcher).Close() error` — stops the watcher and closes the channels.\n- `(*Watcher).Events \u003C-chan Event` — receives change notifications.\n- `(*Watcher).Errors \u003C-chan error` — receives non-fatal errors.\n\nPaths are canonicalized (absolute, cleaned, with symlinks resolved when the target exists; on Windows 8.3 short forms are expanded and case is folded), so two spellings of the same path dedupe and `Event.Name` is always returned in canonical form.\n\n## Events\n\n| Op     | Description                                 |\n|--------|---------------------------------------------|\n| Create | A file or directory was created.            |\n| Write  | A file's contents were modified.            |\n| Remove | A file or directory was removed.            |\n| Rename | A file or directory was renamed or moved.   |\n| Chmod  | Permissions or attributes changed.          |\n\n`Op` is a bitmask; combine values with `|` when calling `Add`. The `All` constant is shorthand for the union of every Op bit.\n\n## Guarantees\n\n- Thread-safe: methods may be called from multiple goroutines.\n- Event ordering is preserved as far as the underlying OS allows.\n- Behavior is normalized across supported platforms.\n\n## Platform Support\n\n| OS      | Backend                 | Status    |\n|---------|-------------------------|-----------|\n| Linux   | inotify                 | Supported |\n| Windows | ReadDirectoryChangesW   | Supported |\n| macOS   | FSEvents (purego)       | Supported |\n| FreeBSD | kqueue                  | Supported |\n\n## License\n\nMIT\n","fswatcher 是一个用于 Go 语言的跨平台文件系统通知库。它提供了监听文件或目录创建、修改、删除等事件的功能，并支持通过简单的 API 进行路径注册和事件处理。该库利用了不同操作系统底层的文件监控机制（如 inotify, kqueue, ReadDirectoryChangesW），确保了在 Windows、Linux 和 macOS 等多个平台上的一致性和高效性。适用于需要实时响应文件变动的应用场景，比如开发环境下的热重载、日志监控工具或是自动化构建系统等。",2,"2026-06-11 03:54:30","CREATED_QUERY"]