欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

node red 调研

程序员文章站 2022-07-14 22:46:48
...
RED API entry point returned by require('node-red');
  .init(server,settings) Initialises Node-RED
  .start() Start Node-RED
  .stop() Stop Node-RED
  .version() Returns the version
  .httpAdmin The admin express application
  .httpNode The node express application
  .server The http server instance
RED.auth Authentication middleware
    .needsPermission(permission) Middleware used to ensure a user has a specific permission
RED.comms
    .publish(msg) Send a message to the editor
RED.library
    .register(type) Register a type to the library
RED.log Logging services
    .addHandler(func) Add a log handler
    .log(msg) Log a message
    .info(msg) Log an info-level message
    .warn(msg) Log a warning-level message
    .error(msg) Log an error-level message
    .trace(msg) Log a trace-level message
    .debug(msg) Log a debug-level message
    .metric() Check if metrics are enabled in the runtime
    .audit(msg,req) Log an audit event
    ._(msg,options) Lookup NLS message
RED.nodes Core runtime api
    .getType(type) Get a type definition
    .getNode(id) Get a node configuration
    .eachNode(callback) Iterate over all ndoes
    .installModule(module) Install a new node module
    .uninstallModule(module) Remove a node module
    .enableNode(id) Enable a node set
    .disableNode(id) Disabled a node set
    .getNodeInfo(id) Get a node set’s information
    .getNodeList() Get the list of all available nodes
    .getModuleInfo(id) Get a node module’s information
    .getNodeConfigs() Get the HTML configurations of all active node sets
    .getNodeConfig(id) Get the HTML configuration of a specific node set
    .loadFlows() Load the active flow configuration
    .startFlows() Start the active flow configuration
    .stopFlows() Stop the active flow configuration
    .setFlows(flows,type) Set the active flow configuration
    .getFlows() Get the active flow configuration
    .addFlow(flow) Add a new flow to the active configuration
    .getFlow(id) Get a flow within the active configuration
    .updateFlow(id,flow) Update an existing flow in the active configuration
    .removeFlow(id) Remove a flow from the active configuration
    .addCredentials(id,credentials) Add a credentials entry for a node
    .getCredentials(id) Get the credentials entry for a node
    .deleteCredentials(id) Remove the credentials entry for a node
RED.settings Runtime settings
    .available() Check if settings are available
    .get(key) Get a setting value
    .set(key,value) Set a value in settings
RED.util Common utilities
    .cloneMessage(msg) Clone a message object
    .compareObjects(objA,objB) Compare two javascript objects
    .ensureBuffer(value) Ensure a value is a Buffer type
    .ensureString(value) Ensure a value is a String type
    .evaluateNodeProperty(value,type,node,msg) Evaluate a typed node property
    .generateId() Generate a new id value
    .getMessageProperty(msg,expr) Get a message property
    .setMessageProperty(msg,prop,value,createMissing) Set a message property
##### RED.init(server,settings)

##### RED.start()

##### RED.stop()

##### RED.version()

##### RED.httpAdmin

##### RED.httpNode

##### RED.server

##### RED.auth.needsPermission(permission)

##### RED.comms.publish(msg)

##### RED.library.register(type)

##### RED.log.addHandler(func)

##### RED.log.log(msg)

##### RED.log.info(msg)

##### RED.log.warn(msg)

##### RED.log.error(msg)

##### RED.log.trace(msg)

##### RED.log.debug(msg)

##### RED.log.metric()

##### RED.log.audit(msg,req)

##### RED.log._(msg,options)

##### RED.nodes.getType(type)

##### RED.nodes.getNode(id)

##### RED.nodes.eachNode(callback)

##### RED.nodes.installModule(module)

##### RED.nodes.uninstallModule(module)

##### RED.nodes.enableNode(id)

##### RED.nodes.disableNode(id)

##### RED.nodes.getNodeInfo(id)

##### RED.nodes.getNodeList()

##### RED.nodes.getModuleInfo(id)

##### RED.nodes.getNodeConfigs()

##### RED.nodes.getNodeConfig(id)

##### RED.nodes.loadFlows()

##### RED.nodes.startFlows()

##### RED.nodes.stopFlows()

##### RED.nodes.setFlows(flows,type)

##### RED.nodes.getFlows()

##### RED.nodes.addFlow(flow)

##### RED.nodes.getFlow(id)

##### RED.nodes.updateFlow(id,flow)

##### RED.nodes.removeFlow(id)

##### RED.nodes.addCredentials(id,credentials)

##### RED.nodes.getCredentials(id)

##### RED.nodes.deleteCredentials(id)

##### RED.settings.available()

##### RED.settings.get(key)

##### RED.settings.set(key,value)

##### RED.util.cloneMessage(msg)

##### RED.util.compareObjects(objA,objB)

##### RED.util.ensureBuffer(value)

##### RED.util.ensureString(value)

##### RED.util.evaluateNodeProperty(value,type,node,msg)

##### RED.util.generateId()

##### RED.util.getMessageProperty(msg,expr)

##### RED.util.setMessageProperty(msg,prop,value,createMissing)