Skip to content

Commit

Permalink
v0.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Ustimov committed Oct 4, 2018
1 parent a747b0a commit bc3328d
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
30 changes: 25 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,34 @@ npm install -g node-red-flow-drawer
```
flow-drawer -h
Usage: flow-drawer [options] <inputFile> [outputDir]
Usage: flow-drawer [options] <inputFileOrDir> [outputDir]
Options:
-v, --version output the version number
-f, --format <format> export data format (html, json or images) (default: html)
-n, --nodes <file> path to file with custom node descriptions
-f, --format <format> export data format (html, json or img) (default: html)
-n, --nodes <file> 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
Expand Down Expand Up @@ -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)
[MIT](/LICENSE)

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion src/cli/flow-drawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ let inputFileOrDirValue;
let outputDirValue;

program
.version('0.0.2', '-v, --version')
.version('0.0.3', '-v, --version')
.arguments('<inputFileOrDir> [outputDir]')
.action((inputFileOrDir, outputDir) => {
inputFileOrDirValue = inputFileOrDir;
Expand Down

0 comments on commit bc3328d

Please sign in to comment.