{"id":18332194,"url":"https://github.com/canfoo/hot-update","last_synced_at":"2026-03-14T04:36:55.725Z","repository":{"id":57300691,"uuid":"132076262","full_name":"canfoo/hot-update","owner":"canfoo","description":"Node module hot update","archived":false,"fork":false,"pushed_at":"2018-05-11T05:12:03.000Z","size":665,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T00:02:58.393Z","etag":null,"topics":["module","nodejs"],"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/canfoo.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}},"created_at":"2018-05-04T02:40:04.000Z","updated_at":"2023-07-27T01:22:41.000Z","dependencies_parsed_at":"2022-08-27T01:50:46.468Z","dependency_job_id":null,"html_url":"https://github.com/canfoo/hot-update","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/canfoo%2Fhot-update","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/canfoo%2Fhot-update/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/canfoo%2Fhot-update/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/canfoo%2Fhot-update/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/canfoo","download_url":"https://codeload.github.com/canfoo/hot-update/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247430838,"owners_count":20937873,"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":["module","nodejs"],"created_at":"2024-11-05T19:37:57.705Z","updated_at":"2026-03-14T04:36:55.679Z","avatar_url":"https://github.com/canfoo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hot-update\n\nNode 模块热加载工具\n\n\u003e 平常在开发nodejs，如果修改代码了，需要重启node进程才可以进行验证，这样大大降低了开发效率。虽然现在有一些工具可以配置nodejs文件修改后自动重启进程，但是针对一些比较复杂nodejs代码，比如代码有监听端口功能，重启进程也是一个比较久时间的消耗。开发阶段如果可以只针对某个改变nodejs文件进行重加载，这样就可以节省不必要的等候时间了。module-hot-update正是这样的工具：\n\n[一个例子](https://github.com/canfoo/hot-update/blob/master/example/demo1.js)\n\n\u003cimg src=\"./demo.jpg\" style=\"width: 600px\"\u003e\n\n\n\n## 如何使用\n\n安装\n\n```\nnpm install -D module-hot-update\n```\n\n配置（就是这么简单～）\n\n```javascript\nvar hotUpdate = require('module-hot-update');\nvar path = require('path');\n\n/* path 为需要监听文件的相对路径\n   支持两种格式：String or Array\n   如果为String，可以为路径具体位置，或者某个目录\n   如果为Array，则数组的每一项为某个文件的具体位置\n*/\nhotUpdate(path.join(__dirname, path); \n          \n```\n\n\n\n## 注意\n\n\n\n目前只能对模块导出的内容是Object和Array类型的进行热加载\n\n## TODO\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcanfoo%2Fhot-update","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcanfoo%2Fhot-update","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcanfoo%2Fhot-update/lists"}