Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including mqtt-lambda with all npm packages installed. Try it out:

mqtt-lambda lists no main file and has no index.js, so it can't be directly required. If this is a mistake, please let us know. It may however contain internal files that you can require manually:

// require("mqtt-lambda/[??]")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

mqtt-lambda v1.3.0

A service for hosting independent mqtt subscribers.

mqtt-lambda

A service for hosting independent mqtt subscribers

Running examples

export MQTT_BROKER_URL=mqtt://localhost
export SUBSCRIBERS_ROOT=./examples
npm start

Environment Variables

Required:

MQTT_BROKER_URL:                The url of the mqtt broker
SUBSCRIBERS_ROOT:               The directory to load the lambda subscribers from

Optional:

MQTT_CLIENT_ID:                 The mqtt client's id
MQTT_CLIENT_CONNECT_TIMEOUT:    The client's connection timeout in milliseconds
MQTT_CLIENT_KEEPALIVE:          The client's keep alive in seconds

MQTT_CLIENT_USERNAME:           The client's username
MQTT_CLIENT_PASSWORD:           The client's password

REQUIRE_CLIENT_ID:              Whether or not to require a client id. Set this in your Dockerfile if you require

API_PORT:                       The monitoring api port. Defaults to 80

LAMBDA_LOG_NAME:                The name of the bunyan logger used by mqtt-lambda
LAMBDA_LOG_LEVEL:               The log level used by mqtt-lambda
LAMBDA_VERSION:                 The version to stamp log messages with and show in the web api
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free