Observe file changes with node.js

后端 未结 3 747
栀梦
栀梦 2020-11-28 08:39

I have the following UseCase:

A creates a Chat and invites B and C - On the Server A creates a File. A, B and C writes messages into this file. A,

3条回答
  •  庸人自扰
    2020-11-28 09:19

    Also you could use node-watch. Here's an easy example:

    const watch = require('node-watch')
    
    watch('README.md', function(event, filename) {
      console.log(filename, ' changed.')
    })
    

提交回复
热议问题