| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 4453c0c commit ab65429
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,14 +5,11 @@ var assert = require('assert'); | |||
| 5 | 5 | var fs = require('fs'); | |
| 6 | 6 | var path = require('path'); | |
| 7 | 7 | ||
| 8 | - var f = path.join(common.fixturesDir, 'x.txt'); | ||
| 8 | + const f = path.join(common.fixturesDir, 'x.txt'); | ||
| 9 | 9 | ||
| 10 | - console.log('watching for changes of ' + f); | ||
| 11 | - | ||
| 12 | - var changes = 0; | ||
| 10 | + let changes = 0; | ||
| 13 | 11 | function watchFile() { | |
| 14 | - fs.watchFile(f, function(curr, prev) { | ||
| 15 | - console.log(f + ' change'); | ||
| 12 | + fs.watchFile(f, (curr, prev) => { | ||
| 16 | 13 | changes++; | |
| 17 | 14 | assert.notDeepStrictEqual(curr.mtime, prev.mtime); | |
| 18 | 15 | fs.unwatchFile(f); | |
@@ -24,7 +21,7 @@ function watchFile() { | |||
| 24 | 21 | watchFile(); | |
| 25 | 22 | ||
| 26 | 23 | ||
| 27 | - var fd = fs.openSync(f, 'w+'); | ||
| 24 | + const fd = fs.openSync(f, 'w+'); | ||
| 28 | 25 | fs.writeSync(fd, 'xyz\n'); | |
| 29 | 26 | fs.closeSync(fd); | |
| 30 | 27 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments