Last active
May 24, 2018 17:18
-
-
Save syusui-s/654dae763466e92c740ec1d549280610 to your computer and use it in GitHub Desktop.
This file contains 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
const fs = require('fs'); | |
const process = require('process'); | |
const child_process = require('child_process'); | |
/* watch current directory */ | |
const x = fs.watch('.', (t, f) => { | |
console.log(`eventType: ${t}, file: ${f}`) | |
try { | |
console.log(child_process.execSync(`ls -lah test.js`, { encoding: 'utf-8' })) | |
} catch (e) { | |
// ignore error | |
} | |
}); | |
console.log('start watching') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment