Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

Change-Id: Id0efb4bddc0b6967c5272cc283e8235a058f8c74
  • Loading branch information...
commit e7f7e725097482f8abc9c866977b3eabfbad1154 1 parent ee4b190
Tim Caswell authored
Showing with 12 additions and 2 deletions.
  1. +1 −1  package.json
  2. +11 −1 static.js
View
2  package.json
@@ -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
12 static.js
@@ -3,8 +3,8 @@ 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');
@@ -12,6 +12,16 @@ if (!StreamProto.hasOwnProperty('pipe')) {
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) {
Please sign in to comment.
Something went wrong with that request. Please try again.