The KY-32 obstacle avoidance module, part of the 37 sensors set, uses an infrared light and an infrared receiver to determine whether something is in front of it. Even though the specs say you can set the distance to between 2 and 40 cm’s, most have only managed to get a little over 10 cm. To do this you have to turn the blue/white potentiometers. Turn the one on the left all the way counter clockwise. Turn the other all the way clock wise. That should set the maximum distance.
To connect it to the NodeMCU, you treat it as a analog device. Connect GND to ground. Next to is Vcc which you connect to 3.3v and next to that is signal which you connect to A0. To read the value, you use the function adc.read(0).
I have not been able to use it yet as a digital sensor (using a trigger) which would allow for having 2 sensors on 1 NodeMCU.