F
Size: a a a
F
H
F
const path = './watch.txt';
fs.writeFileSync(path, data);
const watch = path => {
fs.watch(path, (event, file) => {
// console.dir({ event, file });
load(path);
});
};
const load = path => {
fs.readFile(path, 'utf8', (err, data) => {
if (err) throw err;
content = data;
// console.log('\x1Bc');
// console.log('Length: ' + content.length);
console.log(content);
});
};
load(path);
watch(path);
H
const path = './watch.txt';
fs.writeFileSync(path, data);
const watch = path => {
fs.watch(path, (event, file) => {
// console.dir({ event, file });
load(path);
});
};
const load = path => {
fs.readFile(path, 'utf8', (err, data) => {
if (err) throw err;
content = data;
// console.log('\x1Bc');
// console.log('Length: ' + content.length);
console.log(content);
});
};
load(path);
watch(path);
H
F
F
F
K
F
H
AO
F
F
A
F
F
F
F
F