consolr
Advanced tools
Comparing version 0.8.0 to 0.8.1
@@ -6,3 +6,3 @@ var events = require('events'); | ||
process.stdin.on('data', function(chunk){ | ||
var pattern = /(?:\:)(\w+)(?:\s)?([\w \.\,]+)?/gi; | ||
var pattern = /(?:\:)(\w+)(?:\s)?([\w \.\,\"]+)?/gi; | ||
var text = chunk.toString().replace(/(\r\n|\n|\r)/g, ""); | ||
@@ -9,0 +9,0 @@ if(matched = pattern.exec(text)){ |
{ | ||
"name": "consolr", | ||
"version": "0.8.0", | ||
"version": "0.8.1", | ||
"description": "A handler for the input from terminal (process.stdin) acting as events to handle internal server commands", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
@@ -6,3 +6,3 @@ # consolr | ||
### Version | ||
0.8.0 | ||
0.8.1 | ||
@@ -30,3 +30,3 @@ ### Installation | ||
``` | ||
Custom events, to create custom events just type :yourcustomevent and then some text if you need it. eg. :exit "Closing the app" | ||
Custom events, to create custom events just type :yourcustomevent and then some text if you need it. eg. :exit Closing the app | ||
```javascript | ||
@@ -33,0 +33,0 @@ var consolr = require('consolr'); |
var consolr = require('../index'); | ||
console.log("Hello, To use this package just subscribe to the consolr event, or if you want custom events just start typing :YOUR_CUSTOM_EVENT \ | ||
\nExample:\n:custom text that you want to send and ENTER"); | ||
\nExample:\n:custom text that you want to send and ENTER \ | ||
\n\t :exit (To exit the program)"); | ||
@@ -12,2 +13,6 @@ consolr.on('command', function(command){ | ||
console.log("Custom " + command); | ||
}); | ||
consolr.on('exit', function(){ | ||
process.exit(); | ||
}); |
2423
26