{"id":21735809,"url":"https://github.com/clappcodes/hmr","last_synced_at":"2026-05-18T11:38:09.508Z","repository":{"id":212281538,"uuid":"729972347","full_name":"clappcodes/hmr","owner":"clappcodes","description":null,"archived":false,"fork":false,"pushed_at":"2023-12-13T12:03:27.000Z","size":32,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-25T20:44:56.826Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/clappcodes.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-12-10T22:43:46.000Z","updated_at":"2023-12-10T22:44:20.000Z","dependencies_parsed_at":"2023-12-13T13:26:02.086Z","dependency_job_id":"ae24f87a-42fa-4fd2-8038-d707d6deda4d","html_url":"https://github.com/clappcodes/hmr","commit_stats":null,"previous_names":["clappcodes/hmr"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clappcodes%2Fhmr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clappcodes%2Fhmr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clappcodes%2Fhmr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clappcodes%2Fhmr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clappcodes","download_url":"https://codeload.github.com/clappcodes/hmr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244713886,"owners_count":20497730,"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-26T05:14:55.661Z","updated_at":"2026-05-18T11:38:04.489Z","avatar_url":"https://github.com/clappcodes.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @clapp/hmr\n\n## Usage\n```js\nrequire('@clapp/hmr')(() =\u003e {\n  require('./your-dev-module');\n});\n```\n\n* `callback` Function which will be called each time when some file was changed\n* `options` Options\n  * `debug` Show list of modules which was removed from the cache. Default: false\n  * `watchDir` Relative path to the directory to be watched recursively. Default: directory of the  current module\n  * `watchFilePatterns` Files that will trigger reload on change. Default: `[\"**/*.ts\", \"**/*.js\"]`\n  * `chokidar` Chokidar [options](https://github.com/paulmillr/chokidar#api)\n\n## Example\n`route.ts`\n```ts\nfunction route(req: http.Request, res: http.Response): http.RequestListener {\n  res.write('Hello World');\n  res.end()\n});\n\nexport default route;\n```\n\n`index.ts`\n```ts\nimport http from 'http';\nimport hmr from '@clapp/hmr';\n\nlet route: http.RequestListener;\n\nhmr(async () =\u003e {\n  console.log('Reloading app...');\n  ({ default: route } = await import('./route'));\n});\n\nconst server = http.createServer((req, res) =\u003e route(req, res));\n\nserver.listen(3000);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclappcodes%2Fhmr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclappcodes%2Fhmr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclappcodes%2Fhmr/lists"}