Things we will use
- Sublime Text
〰 You can use any text-editor or terminal of your choice
- Nodemon Plugin
⚠️ Nodemon is a utility that will monitor for any changes in your source and automatically restart your server. Perfect for development.
- First Open Sublime Text editor and open your project into it by dragging and then dropping the project folder on its window or by selecting project folder by selecting File > Open….
- Then open iTerm and change directory to your project directory.
- Then, add
nodemon.jsonfile at the root of your project and the following data into that file.
We are clearing the console before executing the file. It will give us a clear console and a distraction free environment. So, for that we are binding
clearcommand with start event of nodemon.
nodemon --quite YOUR_FILENAME.js
What it will do is, it will watch your file for changes and execute that file if any changes are made.
--quite will disable
nodemonlogs in order to provide you distraction free output.
- Now open both of them side-by-side and start writing code, hit
cmd + Sin case of macOS ) to save the file and see the output simultaneously.
⚠️ If you are using macOSX, you can split both of them into a separate window. If will provide you a complete distraction free environment. If you are using linux or windows, you can resize them and keep them side-by-side.
This was a problem that I had and then I tried to solve it. Now just write your code and then just hit
ctrl + S and the output of that code is in front of you. Just spend your time on thinking about the problem not about how to test it.
Now go and practice like a pro 👍
If you like this article, please give it some claps 👏 and share it! If you do not like this post or have any type of questions regarding anything that I mentioned in this post. Feel free to ask me. Just post an issue in my “Ask Me Anything” by clicking here.
Don’t forget to 👆 subscribe our weekly-newsletter service for web hackers. All latest articles and stuff like trending repositories, straight to your mailbox 📬.