These two variables were added in the latest version:
let numAxes = 4;
let numButtons = 8;
You have to adjust the number accordingly. Every joystick has two axes. For the triggers, it will probably be one per trigger.
The values are sent via websockets. The protocol is very simple.
Axis command:Axis number:Axis value
websocket.send('a:0:0.123');