This this video shows how to use L298N Module with ESP8266 NodeMCU or D1 Mini wami LOLIN to fully control a DC motor. Please use the "Download" button to get just Arduino code or download the zip file which has the Arduino code and .h file.
This code is to control only speed of the motor. Full Control Code is here
You need to download
-ESP-L298N library for L298N.
-Arduino code and .h file as zip