Permalink
Browse files

Fix v0.2.x compat for static and bump version

Change-Id: Id0efb4bddc0b6967c5272cc283e8235a058f8c74
  • Loading branch information...
Tim Caswell
Tim Caswell committed Jan 4, 2011
1 parent ee4b190 commit e7f7e725097482f8abc9c866977b3eabfbad1154
Showing with 12 additions and 2 deletions.
  1. +1 −1 package.json
  2. +11 −1 static.js
View
@@ -2,7 +2,7 @@
"name": "creationix",
"description": "Creationix is a meta package for my personal packages",
"tags": ["stack", "creationix", "meta", "sandbox"],
- "version": "0.0.5",
+ "version": "0.0.6",
"author": "Tim Caswell <tim@creationix.com>",
"repository": {
"type": "git",
View
@@ -3,15 +3,25 @@ var Path = require('path'),
Fs = require('fs'),
getMime = require('simple-mime')("application/octet-stream");
+// Compat stuff to make this work on the v0.2.x and v0.3.x branches of node
var ENOENT = process.ENOENT || require('constants').ENOENT;
-
var StreamProto = require('net').Stream.prototype.__proto__;
if (!StreamProto.hasOwnProperty('pipe')) {
var sys = require('sys');
StreamProto.pipe = function (other) {
sys.pump(this, other);
};
}
+if (!process.EventEmitter.prototype.hasOwnProperty('once')) {
+ process.EventEmitter.prototype.once = function (type, listener) {
+ var self = this;
+ self.on(type, function g() {
+ self.removeListener(type, g);
+ listener.apply(this, arguments);
+ });
+ return this;
+ };
+}
// Super simple static file server
module.exports = function setup(mount, root, index) {

0 comments on commit e7f7e72

Please sign in to comment.