In nodejs the require global is something that will end up being used often in projects as a way to make use of built in as well as custom made nodejs modules. There is more to it then just a way to load modules though, it can also be used as a way to load json files and other assets, so lets take a look at some nodejs require examples today.
In the above example I am using the operating system module to find out the current operating system platform that the script is running on. There is a wide range of other built in modules to work with so be sure to check those out first to see if they work out okay before looking into npm packages.
Another thing about the node.js require global is that it can also be used as a way to read and parse external JSON data. This is often a quicker option to using the file system module and JSON.parse, however it can still produce an error in the event that the file contains invalid JSON data.