{"id":18653840,"url":"https://github.com/sagernet/fswatch","last_synced_at":"2025-07-05T07:33:12.451Z","repository":{"id":246062196,"uuid":"819989336","full_name":"SagerNet/fswatch","owner":"SagerNet","description":"A simple fsnotify wrapper to watch file updates correctly","archived":false,"fork":false,"pushed_at":"2024-06-26T02:58:54.000Z","size":6,"stargazers_count":5,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-07T07:28:09.067Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SagerNet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-25T15:19:27.000Z","updated_at":"2025-04-06T23:53:19.000Z","dependencies_parsed_at":"2024-06-25T17:05:47.419Z","dependency_job_id":"a904010c-5efc-421b-9e95-32b89d756871","html_url":"https://github.com/SagerNet/fswatch","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"f530f488bbbc86a80227dd657aaccd98c00488d6"},"previous_names":["sagernet/fswatch"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SagerNet%2Ffswatch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SagerNet%2Ffswatch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SagerNet%2Ffswatch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SagerNet%2Ffswatch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SagerNet","download_url":"https://codeload.github.com/SagerNet/fswatch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248441334,"owners_count":21103971,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T07:13:20.082Z","updated_at":"2025-04-11T16:33:03.057Z","avatar_url":"https://github.com/SagerNet.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fswatch\n\n![Test](https://github.com/sagernet/fswatch/actions/workflows/test.yml/badge.svg)\n![Lint](https://github.com/sagernet/fswatch/actions/workflows/lint.yml/badge.svg)\n[![Go Reference](https://pkg.go.dev/badge/github.com/sagernet/fswatch.svg)](https://pkg.go.dev/github.com/sagernet/fswatch)\n\nfswatch is a simple [fsnotify] wrapper to watch file updates correctly.\n\n[fsnotify]: https://github.com/fsnotify/fsnotify\n\nInstall\n---\n\n```bash\ngo get github.com/sagernet/fswatch\n```\n\nExample\n---\n\n```go\npackage main\n\nimport (\n\t\"log\"\n\n\t\"github.com/sagernet/fswatch\"\n)\n\nfunc main() {\n\tvar watchPath []string\n\twatchPath = append(watchPath, \"/tmp/my_file\")\n\twatcher, err := fswatch.NewWatcher(fswatch.Options{\n\t\tPath: watchPath,\n\t\tCallback: func(path string) {\n\t\t\tlog.Println(\"file updated: \", path)\n\t\t},\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer watcher.Close()\n\t// Block main goroutine forever.\n\t\u003c-make(chan struct{})\n}\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsagernet%2Ffswatch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsagernet%2Ffswatch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsagernet%2Ffswatch/lists"}