I am just starting out with electronics. I got a Arduino Mega 2560 board and am able to do simple things like blink. Now I want to start a project on IoT and want to connect this board with internet. I got some leads here. While googling ESP8266, I came across NodeMCU which has a processor too. I already have Arduino, so can I use only the wifi module of NodeMCU and connect it to Arduino?
I went through almost the exact same thing you are going through when I was looking at the ESP8266 boards (the NodeMCU is one of those). I too discovered that the NodeMCU is a micro computer in itself, even more powerful than the Arduino UNO!
You can even code the NodeMCU using the Arduino IDE. As has been said previously, I'd use your NodeMCU directly to accomplish what you want to do.