https://github.com/chenshenhai/node-hot-update
hot update js code for nodejs server without restarting | 热更新node.js的js文件
https://github.com/chenshenhai/node-hot-update
hot-require hot-update nodejs
Last synced: 7 months ago
JSON representation
hot update js code for nodejs server without restarting | 热更新node.js的js文件
- Host: GitHub
- URL: https://github.com/chenshenhai/node-hot-update
- Owner: chenshenhai
- License: mit
- Created: 2017-05-30T14:00:02.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-06-03T14:03:17.000Z (over 8 years ago)
- Last Synced: 2025-04-14T11:56:07.483Z (7 months ago)
- Topics: hot-require, hot-update, nodejs
- Language: JavaScript
- Homepage:
- Size: 9.77 KB
- Stars: 3
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hot-update
## English instructions
### Information
This module refers to `hot-require` and enhanced fault tolerance.
Thank you to the author of `hot-require`.
Hot update js code without restart server for NodeJs,
### Installation
```sh
npm install --save hot-update
```
### Getting started
```js
const hotUpdate = require('hot-update');
setInterval(()=>{
let Mod1 = hotUpdate('./modules/mod1');
let Mod2 = hotUpdate('./modules/mod2');
let Obj1 = hotUpdate('./modules/obj1');
console.log(m1.data, m2.data, Obj1.data);
}, 3000);
```
## 中文说明
### 简介
本模块主要用于js文件的热更新,不需要重启node.js服务。
本模块参考模块 `hot-require` ,并且添加容错处理,对象字面量处理。
在此,对模块 `hot-require` 的作者表示感谢。
### 安装
```sh
npm install --save hot-update
```
### 快速开始
```js
const hotUpdate = require('hot-update');
setInterval(()=>{
let Mod1 = hotUpdate('./modules/mod1');
let Mod2 = hotUpdate('./modules/mod2');
let Obj1 = hotUpdate('./modules/obj1');
console.log(m1.data, m2.data, Obj1.data);
}, 3000);
```