Esp NODEMCU powered from external 3.3v source and USB
Connect a low drop Schottky diode in series with the battery positive pin before connecting it to node MCU power Pin. This will ensure that the on board regulator won't try to charge the battery. Disadvantage is that the final vorlage which will reach the node MCU will be battery voltage minus the diode drop.
You can also use a PFET as a reverse polarity protection instead of diode. Advantage is you will get a Vorlage drop in a few 10s of mV instead of a few 100s of mV drop.
Advantages of both the above approach: provides inherent Reverse polarity protection
Check the leakage current of Schottky diode. It might even kill your project if it is a battery operated device. 
If you are planning to charge the battery via 5V pin on the MCU e make sure you will not be drawing more current from the USB port,else you can damage the computer Port. 
Charging a battery from the USB port of computer isn't a good idea. For charging purpose can you may use a 5 V wall adapter (phone chargers?) Still, when you are trying to program and if the battery charging circuit isn't disconnected, it can atleast harm the PC port temporarily.
Also note that some PC USB ports won't even give more than 100 mA of current unless the slave device asks for it.