In this post I will load mongoose OS to nodemcu. mongoose provides a nice browser based editor to edit the code and you can upload the code to device from the same window. It makes developing IoT based applications much easier.
first download the windows executable from here. Connect nodemcu to system and run the mos.exe.
select the COM port from the drop down and click on select. Select esp8266 as device and click on Flash button , some times you may get access denied error , you can also load the firmware using the cmd line
navigate to the folder in which mos.exe is present and run the following command
mos flash mos-esp8266
if you had loaded the firmware and connected to wifi, you should see the device online
iot.eclipse.org:1883. You can change the default MQTT broker address in conf0.json