This file contains hidden or 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
| #!node | |
| var fs = require('fs'), | |
| path = require('path'), | |
| gzip = require('./gzip'); | |
| function process(fileBody, options, cb) { | |
| if(typeof(fileBody) === 'object') { | |
| options = fileBody; | |
| fileBody = undefined; | |
| cb = options; |
This file contains hidden or 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
| /** | |
| * Watch a directory recursively | |
| * | |
| * @param {String} dir | |
| * @param {Function} cb | |
| * | |
| * watchRecursive('directory', function(current) { | |
| * console.log(current, ' changed'); | |
| * }); | |
| */ |
This file contains hidden or 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
| var fs = require('fs'); | |
| var util = require('util'); | |
| var writer = fs.createWriteStream('../log.txt'); | |
| fs.watch('.', function (event, filename) { | |
| writer.write('================\nEvent: ' + event + '\n'); | |
| if (filename) { |
OlderNewer