-
Notifications
You must be signed in to change notification settings - Fork 4
RED settings
cflurin edited this page Dec 20, 2018
·
2 revisions
This isn't a typical dsm use case, it uses the dsm methods to get some infos about the node-red settings.
{
"methods": {
"init": [
"sm.userDir = RED.settings.userDir;",
"sm.dsmVersion = require(sm.userDir+'/node_modules/node-red-contrib-dsm/package.json').version;"
],
"onTransition": [
"msg.payload = {};",
"var s = RED.settings;",
"msg.payload.nodeRedVersion = s.version;",
"msg.payload.dsmVersion = sm.dsmVersion;",
"msg.payload.coreNodesDir = s.coreNodesDir;",
"msg.payload.userDir = s.userDir;",
"msg.payload.settingsFile = s.settingsFile;",
"msg.payload.logging = s.logging.console.level;",
"msg.payload.functionGlobalContext = s.functionGlobalContext;",
"msg.payload.contextStorage = s.contextStorage;",
"output = true;"
]
}
}
[{"id":"7f35fa6e.fa5504","type":"dsm","z":"ac4aa9f6.c24288","name":"RED settings","sm_config":"{\n \"methods\": {\n \"init\": [\n \"sm.userDir = RED.settings.userDir;\",\n \"sm.dsmVersion = require(sm.userDir+'/node_modules/node-red-contrib-dsm/package.json').version;\"\n ],\n \"onTransition\": [\n \"msg.payload = {};\",\n \"var s = RED.settings;\",\n \"msg.payload.nodeRedVersion = s.version;\",\n \"msg.payload.dsmVersion = sm.dsmVersion;\",\n \"msg.payload.coreNodesDir = s.coreNodesDir;\",\n \"msg.payload.userDir = s.userDir;\",\n \"msg.payload.settingsFile = s.settingsFile;\",\n \"msg.payload.logging = s.logging.console.level;\",\n \"msg.payload.functionGlobalContext = s.functionGlobalContext;\",\n \"msg.payload.contextStorage = s.contextStorage;\",\n \"output = true;\"\n ]\n }\n}","x":360,"y":200,"wires":[["f9841105.99ee6"]]},{"id":"f4788ecd.1100d","type":"inject","z":"ac4aa9f6.c24288","name":"","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":210,"y":200,"wires":[["7f35fa6e.fa5504"]]},{"id":"f9841105.99ee6","type":"debug","z":"ac4aa9f6.c24288","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":530,"y":200,"wires":[]}]