Permalink
Browse files

Merge pull request #16 from fgnass/master

emit a file event
  • Loading branch information...
2 parents f14b837 + b37af8b commit 1b24cafd550e32032f0080179b4da369ac7ab9fd @tj tj committed Feb 21, 2013
Showing with 2 additions and 0 deletions.
  1. +1 −0 Readme.md
  2. +1 −0 lib/send.js
View
@@ -57,6 +57,7 @@ var app = http.createServer(function(req, res){
- `error` an error occurred `(err)`
- `directory` a directory was requested
+ - `file` a file was requested `(path, stat)`
- `stream` file streaming has started `(stream)`
- `end` streaming has completed
View
@@ -319,6 +319,7 @@ SendStream.prototype.pipe = function(res){
fs.stat(path, function(err, stat){
if (err) return self.onStatError(err);
if (stat.isDirectory()) return self.redirect(self.path);
+ self.emit('file', path, stat);
self.send(path, stat);
});

0 comments on commit 1b24caf

Please sign in to comment.