Created Design: Node blacklist/whitelist function (markdown)

kazuhitoyokoi 2017-03-09 11:20:50 +00:00
parent 81900fdd24
commit b871e20357
1 changed files with 22 additions and 0 deletions

@ -0,0 +1,22 @@
## Use cases
- To use only nodes which correspond with operation policy
- To avoid/accept the installation of specific nodes
## Node blacklist function
Current Node-RED has blacklist function using nodesExclude in settings.js
For example, [bluemix-settings.js](https://github.com/ibmets/node-red-bluemix-starter/blob/master/bluemix-settings.js) in node-red-bluemix-starter includes the following configuration.
```
nodesExcludes:['66-mongodb.js','75-exec.js','35-arduino.js','36-rpi-gpio.js','25-serial.js','28-tail.js','50-file.js','31-tcpin.js','32-udp.js','23-watch.js']
```
In this case, Node-RED doesn't load these nodes into Node-RED palette when it starts.
nodesExcludes supports array of JavaScript file names and module names.
## Node whitelist function
The [pull request](https://github.com/node-red/node-red/pull/1184) of node whitelist function was posted for Node-RED v0.17.
To use the whitelist function, settings.js should have nodesIncludes.
nodesIncludes also supports array of JavaScript file names and module names.
For example, inject, debug, twitter-in and twitter-out nodes will be shown on Node-RED palette when nodesInclude has the following configuration.
```
nodesIncludes: ['20-inject.js','58-debug.js','node-red-node-twitter']
```
If both nodesExcludes and nodesIncludes are used in the settings.js, Node-RED palette has nodes of nodesIncludes except nodes of nodesExcludes.