@node-red/runtime.nodes

addModule(opts) → {Promise.<ModuleInfo>}

Install a new module into the runtime

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

module String

the id of the module to install

version String

(optional) the version of the module to install

Returns:
Type:
Promise.<ModuleInfo>
  • the node module info

getIcon(opts) → {Promise.<Buffer>}

Gets a node icon

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

module String

the id of the module requesting the icon

icon String

the name of the icon

Returns:
Type:
Promise.<Buffer>
  • the icon file as a Buffer or null if no icon available

getIconList(opts) → {Promise.<IconList>}

Gets the list of all icons available in the modules installed within the runtime

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

Returns:
Type:
Promise.<IconList>
  • the list of all icons

getModuleCatalog(opts) → {Promise.<Object>}

Gets a modules message catalog

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

module User

the module

lang User

the i18n language to return. If not set, uses runtime default (en-US)

Returns:
Type:
Promise.<Object>
  • the message catalog

getModuleCatalogs(opts) → {Promise.<Object>}

Gets all registered module message catalogs

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

lang User

the i18n language to return. If not set, uses runtime default (en-US)

Returns:
Type:
Promise.<Object>
  • the message catalogs

getModuleInfo(opts) → {Promise.<ModuleInfo>}

Gets the info of a node module

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

module String

the id of the module to return

Returns:
Type:
Promise.<ModuleInfo>
  • the node module info

getNodeConfig(opts) → {Promise.<String>}

Gets an individual node's html content

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

id String

the id of the node set to return

lang String

the locale language to return

Returns:
Type:
Promise.<String>
  • the node html content

getNodeConfigs(opts) → {Promise.<String>}

Gets all node html content

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

lang String

the locale language to return

Returns:
Type:
Promise.<String>
  • the node html content

getNodeInfo(opts) → {Promise.<NodeInfo>}

Gets the info of an individual node set

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

id String

the id of the node set to return

Returns:
Type:
Promise.<NodeInfo>
  • the node information

getNodeList(opts) → {Promise.<NodeList>}

Gets the list of node modules installed in the runtime

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

Returns:
Type:
Promise.<NodeList>
  • the list of node modules

removeModule(opts) → {Promise}

Removes a module from the runtime

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

module String

the id of the module to remove

Returns:
Type:
Promise
  • resolves when complete

setModuleState(opts) → {Promise.<ModuleInfo>}

Enables or disables a module in the runtime

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

module String

the id of the module to enable or disable

enabled String

whether the module should be enabled or disabled

Returns:
Type:
Promise.<ModuleInfo>
  • the module info object

setNodeSetState(opts) → {Promise.<ModuleInfo>}

Enables or disables a n individual node-set in the runtime

Parameters:
Name Type Description
opts Object
Name Type Description
user User

the user calling the api

id String

the id of the node-set to enable or disable

enabled String

whether the module should be enabled or disabled

Returns:
Type:
Promise.<ModuleInfo>
  • the module info object