summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md22
1 files changed, 14 insertions, 8 deletions
diff --git a/README.md b/README.md
index 99ae4fb..6671109 100644
--- a/README.md
+++ b/README.md
@@ -1,9 +1,12 @@
-# tomato-sauce
+## Tomato Sauce
+
Draw stuff via telnet
## How to run
-`npm install` and then run ``./bin/server.js`. It will listen on port 9999
+You will need [Node.js][node] installed, at least version 8. Install
+dependencies by running `npm install` from the root of the project
+and start the server by running `npm start`. It will listen on port 9999
by default.
## Configuration variables
@@ -27,8 +30,8 @@ the width of the viewport, the height of the viewport, and a renderer
function, and it returns a string that consists of the commands that
will be sent to the socket.
- * `TomatoSauce.IScreen(modulation <int>, width <int>, height <int>, renderer
- <TomatoSauce.IRenderer>) -> payload <string>`
+ * `IScreen(modulation <int>, width <int>, height <int>, renderer
+ <IRenderer>) -> payload <string>`
It should output the required commands that telnet needs to move the
cursor and draw. For convenience, a renderer function is passed so
@@ -46,7 +49,7 @@ You can build your own renderer by building a function that receives a
red, green, and blue component from 0 to 255 and returns the escape
codes to generate the color.
- * `TomatoSauce.IRenderer(red <int>, green <int>, blue <int>) ->
+ * `IRenderer(red <int>, green <int>, blue <int>) ->
colorString <string>`
## Using as a library
@@ -62,12 +65,14 @@ const TomatoSauce = require('tomato-sauce');
const tomatoSauce = new TomatoSauce(config);
-tomatoSauce.on('listening', function () {
+tomatoSauce.on('listening', () => {
+
const address = event.data.server.address();
console.log(`Tomato Sauce listening on: ${address.address}:${address.port}`);
});
-tomatoSauce.on('error', function (error) {
+tomatoSauce.on('error', (error) => {
+
console.error(error);
});
@@ -86,4 +91,5 @@ optional.)
(Defaults to 5)
* `screens`: An array containing the screen functions (Defaults to [])
* `renderers`: An array containing the renderer functions (Defaults to [])
-```
+
+[node]: https://nodejs.org/en/