From d2cb10e3f1860a57908f4952dc15a96363834305 Mon Sep 17 00:00:00 2001 From: Kazuki-Nakanishi Date: Thu, 9 Mar 2017 16:09:09 +0000 Subject: [PATCH] Created Design: Node settings (markdown) --- Design:-Node-settings.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Design:-Node-settings.md 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