-# 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
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
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
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);
});
(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/