Comparing version 0.0.1 to 0.0.2
@@ -13,3 +13,3 @@ var repl = require('repl') | ||
var replClients = 0 | ||
this.clientCount = 0 | ||
@@ -25,4 +25,4 @@ net.createServer(function (socket) { | ||
.on('exit', function() { | ||
replClients-- | ||
self.emit('replDisonnected') | ||
self.clientCount-- | ||
self.emit('replDisonnected', self.clientCount) | ||
socket.end() | ||
@@ -38,10 +38,15 @@ }) | ||
.on('connection', function() { | ||
replClients++ | ||
self.emit('replConnected') | ||
self.clientCount++ | ||
self.emit('replConnected', self.clientCount) | ||
}) | ||
.listen(config.port, config.host || 'localhost', function() { | ||
console.log('REPL started.') | ||
self.emit('replStarted') | ||
}) | ||
} | ||
util.inherits(Repl, EE) | ||
util.inherits(Repl, EE) | ||
Repl.prototype.clients = function () { | ||
return this.clientCount | ||
} | ||
{ | ||
"name": "replize", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Simple REPL for embedding into applications", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -17,2 +17,3 @@ ### REPLize | ||
- `host` _string_ (default: `localhost`) Interface to bind to | ||
- `prompt` _string_ (default: `> `) REPL prompt | ||
- `context` _object_ To expose something for REPL you attach it to this object. Key name will become the object name you call in the REPL (see example below). | ||
@@ -19,0 +20,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
29242
52
58