Skip to content

Commit cefbb55

Browse files
authored
Merge pull request #1 from node-red/master
update with current nodegen code
2 parents 4c4387a + 744eab1 commit cefbb55

File tree

7 files changed

+663
-386
lines changed

7 files changed

+663
-386
lines changed

README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Node generator for Node-RED
22

3-
Node generator is command line tool to generate Node-RED node modules from several various sources including Swagger specification and function node's source.
3+
Node generator is a command line tool to generate Node-RED node modules from several various sources, including Open API document and function node's source.
44
Using this tool, node developers can dramatically reduce their time to implement Node-RED node modules.
55

66
## Installation
@@ -20,8 +20,8 @@ You may need to run this with `sudo`, or from within an Administrator command sh
2020
Node generator for Node-RED
2121

2222
Supported source:
23+
- Open API document
2324
- Function node (js file in library, "~/.node-red/lib/function/")
24-
- Swagger definition
2525

2626
Options:
2727
-o : Destination path to save generated node (default: current directory)
@@ -31,10 +31,13 @@ You may need to run this with `sudo`, or from within an Administrator command sh
3131
--version : Node version (format: "number.number.number" like "4.5.1")
3232
--keywords : Additional keywords (format: comma separated string, default: "node-red-nodegen")
3333
--category : Node category (default: "function")
34+
--icon : PNG file for node appearance (image size should be 10x20)
35+
--color : Color for node appearance (format: color hexadecimal numbers like "A6BBCF")
3436
--tgz : Save node as tgz file
3537
--help : Show help
38+
-v : Show node generator version
3639

37-
### Example 1. Create original node from Swagger definition
40+
### Example 1. Create an original node from Open API document
3841

3942
- node-red-nodegen http://petstore.swagger.io/v2/swagger.json
4043
- cd node-red-contrib-swagger-petstore
@@ -45,7 +48,7 @@ You may need to run this with `sudo`, or from within an Administrator command sh
4548

4649
-> You can use swagger-petstore node on Node-RED flow editor.
4750

48-
### Example 2. Create original node from function node (JavaScript code)
51+
### Example 2. Create an original node from function node (JavaScript code)
4952

5053
- On Node-RED flow editor, save function node to library with file name (lower-case.js).
5154
- node-red-nodegen ~/.node-red/lib/function/lower-case.js
@@ -58,10 +61,10 @@ You may need to run this with `sudo`, or from within an Administrator command sh
5861
-> You can use lower-case node on Node-RED flow editor.
5962

6063
## Documentation
61-
- [Use cases](docs/index.md#use-cases) ([Japanese](docs/index_ja.md#use-cases))
62-
- [How to use Node generator](docs/index.md#how-to-use-node-generator) ([Japanese](docs/index_ja.md#how-to-use-node-generator))
63-
- [Generated files which node package contains](docs/index.md#generated-files-which-node-package-contains) ([Japanese](docs/index_ja.md#generated-files-which-node-package-contains))
64-
- [How to create node from Swagger definition](docs/index.md#how-to-create-node-from-swagger-definition) ([Japanese](docs/index_ja.md#how-to-create-node-from-swagger-definition))
65-
- [How to create node from function node](docs/index.md#how-to-create-node-from-function-node) ([Japanese](docs/index_ja.md#how-to-create-node-from-function-node))
64+
- [Use cases](https://github.com/node-red/node-red-nodegen/blob/0.0.3/docs/index.md#use-cases) ([Japanese](https://github.com/node-red/node-red-nodegen/blob/0.0.3/docs/index_ja.md#use-cases))
65+
- [How to use Node generator](https://github.com/node-red/node-red-nodegen/blob/0.0.3/docs/index.md#how-to-use-node-generator) ([Japanese](https://github.com/node-red/node-red-nodegen/blob/0.0.3/docs/index_ja.md#how-to-use-node-generator))
66+
- [Generated files which node package contains](https://github.com/node-red/node-red-nodegen/blob/0.0.3/docs/index.md#generated-files-which-node-package-contains) ([Japanese](https://github.com/node-red/node-red-nodegen/blob/0.0.3/docs/index_ja.md#generated-files-which-node-package-contains))
67+
- [How to create a node from Open API document](https://github.com/node-red/node-red-nodegen/blob/0.0.3/docs/index.md#how-to-create-a-node-from-open-api-document) ([Japanese](https://github.com/node-red/node-red-nodegen/blob/0.0.3/docs/index_ja.md#how-to-create-a-node-from-open-api-document))
68+
- [How to create a node from function node](https://github.com/node-red/node-red-nodegen/blob/0.0.3/docs/index.md#how-to-create-a-node-from-function-node) ([Japanese](https://github.com/node-red/node-red-nodegen/blob/0.0.3/docs/index_ja.md#how-to-create-a-node-from-function-node))
6669

6770
Note: Currently node generator supports GET and POST methods using JSON format without authentication.

bin/node-red-nodegen.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ function help() {
6262
' Node generator for Node-RED\n' +
6363
'\n' +
6464
'Supported source:'.bold + '\n' +
65-
' - Function node (js file in library, "~/.node-red/lib/function/")\n' +
65+
' - Open API document\n' +
6666
// ' - Subflow node (json file of subflow)\n' +
67-
' - Swagger definition\n' +
67+
' - Function node (js file in library, "~/.node-red/lib/function/")\n' +
6868
'\n' +
6969
'Options:\n'.bold +
7070
' -o : Destination path to save generated node (default: current directory)\n' +
@@ -74,8 +74,8 @@ function help() {
7474
' --version : Node version (format: "number.number.number" like "4.5.1")\n' +
7575
' --keywords : Additional keywords (format: comma separated string, default: "node-red-nodegen")\n' +
7676
' --category : Node category (default: "function")\n' +
77-
' --icon : png or gif file for node appearance (image size should be 10x20)\n' +
78-
' --color : color for node appearance (format: color hexadecimal numbers like "A6BBCF")\n' +
77+
' --icon : PNG file for node appearance (image size should be 10x20)\n' +
78+
' --color : Color for node appearance (format: color hexadecimal numbers like "A6BBCF")\n' +
7979
' --tgz : Save node as tgz file\n' +
8080
' --help : Show help\n' +
8181
' -v : Show node generator version\n';

0 commit comments

Comments
 (0)