Skip to content

Instantly share code, notes, and snippets.

@tyv
Last active February 1, 2017 16:11
Show Gist options
  • Save tyv/b13bdd617be5a364dd3bd9dd8d023bc9 to your computer and use it in GitHub Desktop.
Save tyv/b13bdd617be5a364dd3bd9dd8d023bc9 to your computer and use it in GitHub Desktop.
const {watch} = require('chokidar');
const {dir} = require('tmp');
const {mkdirSync, writeFileSync} = require('fs');
dir({unsafeCleanup:true, prefix: 'myTmpDir_'}, (err, path, cleanupCallback) => {
watch(path, {
ignored: path => console.log(path)
});
mkdirSync(`${path}/a`);
writeFileSync(`${path}/a/a.txt`, 'a');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment