Comparing version 0.1.0 to 0.1.1
@@ -39,4 +39,8 @@ var EventEmitter = require("events").EventEmitter; | ||
this.emit("connection", connection); | ||
connection.on("line", function(line){ | ||
var parts = line.trim().split(self.delimiter); | ||
line = line.trim(); | ||
self.emit("line", connection, line) | ||
var parts = line.split(self.delimiter); | ||
@@ -43,0 +47,0 @@ if(!parts.length){ |
{ | ||
"name": "cmdsrv", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "simple text protocol command server", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -86,4 +86,7 @@ cmdsrv | ||
## Default Events | ||
* `error` - this is simply the client connection error event being bubbled up to the server. | ||
* `error` - this is simply the client connection error event being bubbled up to the server. listener definition: `function(error)` | ||
* `line` - this is called with each raw line (not split on delimiter or command lowered, etc). listener definition: `function(connection, line)` | ||
* `connection` - this is called with each new connection. listener definition `function(connection)` | ||
## License | ||
@@ -90,0 +93,0 @@ ``` |
6936
80
115