{"id":14978183,"url":"https://github.com/capaj/chokidar-socket-emitter","last_synced_at":"2025-06-22T15:34:52.315Z","repository":{"id":57198191,"uuid":"43829321","full_name":"capaj/chokidar-socket-emitter","owner":"capaj","description":"a simple chokidar watcher which emits events to all connected socket.io clients","archived":false,"fork":false,"pushed_at":"2017-02-07T14:05:33.000Z","size":37,"stargazers_count":28,"open_issues_count":2,"forks_count":22,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-13T22:05:13.317Z","etag":null,"topics":["event-emitter","filesystem","socket-io","watcher"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/capaj.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}},"created_at":"2015-10-07T16:29:14.000Z","updated_at":"2022-05-28T13:37:36.000Z","dependencies_parsed_at":"2022-09-16T13:12:31.493Z","dependency_job_id":null,"html_url":"https://github.com/capaj/chokidar-socket-emitter","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/capaj/chokidar-socket-emitter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capaj%2Fchokidar-socket-emitter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capaj%2Fchokidar-socket-emitter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capaj%2Fchokidar-socket-emitter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capaj%2Fchokidar-socket-emitter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/capaj","download_url":"https://codeload.github.com/capaj/chokidar-socket-emitter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capaj%2Fchokidar-socket-emitter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261314950,"owners_count":23140177,"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":["event-emitter","filesystem","socket-io","watcher"],"created_at":"2024-09-24T13:57:00.681Z","updated_at":"2025-06-22T15:34:47.299Z","avatar_url":"https://github.com/capaj.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# chokidar-socket-emitter\na simple chokidar watcher and socket.io server which emits file system events to all connected socket.io clients. Primarily it should serve as an event source for **[systemjs-hot-reloader](https://github.com/capaj/systemjs-hot-reloader)** but you can use it any other way.\n\n## Install\n```\nnpm i -D chokidar-socket-emitter\n```\n\n## CLI usage\n\n```\nnpm i -g chokidar-socket-emitter\nchokidar-socket-emitter -l 1234\n```\n\navailable CLI options:\n```\n-l, --port \u003cn\u003e\n-p, --path \u003cpath\u003e\n-d, --dir \u003cn\u003e\n-P, --poll  # use when you have a disk mounted over network for example\n-q, --quiet # don't print out any logs\n```\n\nBy default listens on port 5776.\n\n## NPM script usage\nCombined with [browser-sync](https://browsersync.io/):\n\n``` json\n\"scripts\": {\n  \"start\": \"npm run serve \u0026 npm run watch\",\n  \"serve\": \"browser-sync start --server\",\n  \"watch\": \"chokidar-socket-emitter\"\n},\n```\nStart by running:\n```\nnpm start\n```\n\n## Programatic usage\n```javascript\nvar chokidarEvEmitter = require('chokidar-socket-emitter')\nchokidarEvEmitter({port: 8090}) //path is taken from jspm/directories/baseURL or if that is not set up, '.' is used\n//or specify the path\nchokidarEvEmitter({port: 8090, path: '.'})\n\n//you can also supply an http server instance, that way it will run within your server, no need for extra port\nrequire('chokidar-socket-emitter')({app: server})\n```\n\n## FAQ\n\n#### Does chokidar have problems with watching drives mounted from VMs hosts/network?\nYes and if you want it to work, use additional opts property to switch to polling mode\n```\nchokidarEvEmitter({port: 8090, path: '.', chokidar: {usePolling: true}})\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapaj%2Fchokidar-socket-emitter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcapaj%2Fchokidar-socket-emitter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapaj%2Fchokidar-socket-emitter/lists"}