Before we move on to some specific examples, Node.js must be installed. If you happen to not have Node.js set up already, you can obtain installation instructions and all the necessary resources from https://nodejs.org/.
In order to verify the installation, simply type the following in the console:
node -v
At the time of writing, the LTS (long term support) version was 6.9.1.
The Node.js examples presented in this chapter will be rather simplistic. The point of the chapter is not to create bullet-proof Node.js modules, but rather to present and discuss the ideas and code them in such a way that our code is self-explanatory and easy to read and understand.
Since we will be editing simple JS files that are just text files, you can use whatever editor you find suitable for the task. However, I suggest having a look at Visual Studio Code - it is a product from Microsoft, which may make it less approachable for some, but it is a worthy piece of software. It is an easy-to-use, cross-platform editor that not only lets you factor your code, but also has a really good debugger that is a life saver when the code written does not want to work from the beginning. Not to mention the fact that you're not limited to JavaScript, but can also code and debug in other languages, such as C#, C++, F#, Go, Python, PHP, TypeScript, and many more.