NodeMCU GPIO pin interrupt
Look at https://nodemcu.readthedocs.io/en/master/modules/gpio/#gpiotrig
the usage of the function must be:

   gpio.trig(pin, [type [, callback_function]])


pin is the pin that should trigger the interrupt, using the NodeMCU convention the "IO index". The type is probably "up" or "down", to trigger when the button is pressed or released. And callback_function is the name of the function to be called every triggering.