small medium large xlarge

Generic-user-small
14 Jun 2017, 21:03
Moshe Solomon (1 post)

On Windows and node version 6.10.3, each time I save the text file being watched, a message is posted to the client 3 times, so that JSON arrives as three JSON object separated by ‘\n’, so JSON.parse fails. I fixed this issue by using fs.watchFile instead of fs.watch in net-watcher-json-server.js

Avatar_pragsmall
15 Jun 2017, 19:33
Jim R. Wilson (102 posts)

each time I save the text file being watched, a message is posted to the client 3 times, so that JSON arrives as three JSON object separated by ‘\n’, so JSON.parse fails

Interesting! I had heard that the Windows API would send multiple change messages, but I’m surprised that they’re getting concatenated into a single message.

You must be logged in to comment