Node.js app

Running Butler as Node.js app

If the Butler source code has been installed in d:\tools\butler, starting Butler as a Node.js app on Windows could look like this:

cd \tools\butler\src
node butler.js

It is of course also possible to put those commands in a command file (.bat or .ps1 on Windows) file and execute that file instead.

The commands above assume there is a d:\tools\butler\src\config directory in which there is a YAML config file.
The name of that config file should match the value set to the NODE_ENV environment variable.
For example, if NODE_ENV=dev the config file should be d:\tools\butler\src\config\dev.yaml.

The command line options introduced in Butler 7.2 are available also when running Buter as a Node.js app.
Use the --help command line option to show what options are available:

PS D:\tools\butler\src> node butler.js --help
Usage: butler [options]

Butler gives superpowers to client-managed Qlik Sense Enterprise on Windows!
Advanced reload failure alerts, task scheduler, key-value store, file system access and much more.

  -V, --version                   output the version number
  -c, --configfile <file>         path to config file
  -l, --loglevel <level>          log level (choices: "error", "warn", "info", "verbose", "debug", "silly")
  --new-relic-api-key <key>       insert API key to use with New Relic
  --new-relic-account-id <id>     New Relic account ID
  --test-email-address <address>  send test email to this address. Used to verify email settings in the config file.
  -h, --help                      display help for command

Looking at the above, it’s actually possible to use the --configfile to specify which config file to use.

Similarly the --loglevel option can be used to control Butler’s logging.


Any option given on the command line will override the same setting in the config file

Windows services

On Windows you can use the excellent Nssm tool to make Node.js (and also the Butler app) run as a Windows Service, with all the benefits that follow (can be monitored using operations tools, automatic restarts etc).

Last modified 2022-05-25: Additional docs for 8.1.0 (0a4c7f8)