diff --git a/README.md b/README.md index 1f416fc..87d9c79 100644 --- a/README.md +++ b/README.md @@ -15,16 +15,34 @@ npm install -g node-red-flow-drawer ``` flow-drawer -h -Usage: flow-drawer [options] [outputDir] +Usage: flow-drawer [options] [outputDir] Options: -v, --version output the version number - -f, --format export data format (html, json or images) (default: html) - -n, --nodes path to file with custom node descriptions + -f, --format export data format (html, json or img) (default: html) + -n, --nodes path to a file with custom node descriptions + -s, --stdout print results to the stdout (will be ignored for batch processing) -h, --help output usage information +``` + +### Custom node descriptions -flow-drawer --format=json input.json > output.json +This file should contain `RED.nodes.registerType` calls for your custom nodes and the line `const RED = this.RED;` at the top of the file. For instance: + +```javascript +const RED = this.RED; + +RED.nodes.registerType('Cache in',{ + category: 'input', + defaults: { + name: { name: '' }, + }, + color: 'Turquoise', + inputs: 1, + outputs: 1, + icon: "db.png", +}); ``` ### TODO @@ -72,7 +90,9 @@ new FlowDrawer(flows, options) * Use Node-RED fonts * Solid frame around flow's nodes * Proper handling of unnamed nodes +* Tests ## License - [MIT](/LICENSE) \ No newline at end of file + [MIT](/LICENSE) + \ No newline at end of file diff --git a/package.json b/package.json index 2f87cf4..3a51167 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-red-flow-drawer", - "version": "0.0.2", + "version": "0.0.3", "description": "A Node-RED flow drawer", "main": "src/flow-drawer.js", "scripts": { diff --git a/src/cli/flow-drawer.js b/src/cli/flow-drawer.js index b488f3d..ae608f6 100644 --- a/src/cli/flow-drawer.js +++ b/src/cli/flow-drawer.js @@ -8,7 +8,7 @@ let inputFileOrDirValue; let outputDirValue; program - .version('0.0.2', '-v, --version') + .version('0.0.3', '-v, --version') .arguments(' [outputDir]') .action((inputFileOrDir, outputDir) => { inputFileOrDirValue = inputFileOrDir;