Use Arduino to turn fan on / off
Depending of the type of fan you are using, two solutions exist. 


First one, use a MOSFET to drive the FAN from you nodemcu 
Second one, use a relay to drive the FAN from your nodemcu 


Things to consider :


The mosfet allow you to drive the fan without mechanical part moving. 
The relay require some transistor and feedback diode to be driven by your µc.