@node-red/runtime

This module provides the core runtime component of Node-RED. It does not include the Node-RED editor. All interaction with this module is done using the api provided.

Members

comms : { ... }
context : { ... }
flows : { ... }
library : { ... }
nodes : { ... }
plugins : { ... }
projects : { ... }
settings : { ... }

init(settings, server, adminApi)

Initialise the runtime module.

Parameters:
Name Type Description
settings Object

the runtime settings object

server HTTPServer

the http server instance for the server to use

adminApi AdminAPI

an instance of @node-red/editor-api. TODO: This needs to be better abstracted.

isStarted(opts) → {Promise.<Boolean>}

Returns whether the runtime is started

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

the user calling the api

Returns:
Type:
Promise.<Boolean>
  • whether the runtime is started

start() → {Promise}

Start the runtime.

Returns:
Type:
Promise
  • resolves when the runtime is started. This does not mean the flows will be running as they are started asynchronously.

stop() → {Promise}

Stops the runtime.

Once called, Node-RED should not be restarted until the Node.JS process is restarted.

Returns:
Type:
Promise
  • resolves when the runtime is stopped.

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

Returns version number of the runtime

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

the user calling the api

Returns:
Type:
Promise.<String>
  • the runtime version number