Created
November 16, 2018 16:28
-
-
Save converge/6ddfcf465fc9cf6ba40c7e9d5e984b5f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// next step: every time there is a new log, call socket.emit('newLogData') | |
io.on('connection', function (socket) { | |
console.log('connected <-') | |
// @todo: windows version | |
var tail = spawn("tail", ["-f", filename]); | |
tail.stdout.on("data", function (data) { | |
console.log(data.toString('utf-8')) | |
socket.emit('newLogData', { newLog: data.toString('utf-8') } ) | |
}); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment