diff --git a/Design:-Node-settings.md b/Design:-Node-settings.md new file mode 100644 index 0000000..7f1d5f5 --- /dev/null +++ b/Design:-Node-settings.md @@ -0,0 +1,26 @@ +/settings API returns only the following built-in fields by default. + +http://nodered.jp/docs/api/admin/methods/get/settings/ + +A node can add their own settings to the above settings. + +### Adding a setting +The way to register a node is as follows (https://nodered.org/docs/creating-nodes/first-node). + +`RED.nodes.registerType("lower-case",LowerCaseNode);` + +To add a node setting, add setting object. +``` +RED.nodes.registerType("lower-case",LowerCaseNode,{ + settings: { + lowerCaseLength:{ + value: "10", + exportable: true + } + } +}); +``` +* `value` - The value corresponding with the object name. +* `exportable` - Whether the value will be output or not. + +### Overwriting a node setting by settings.js