Learning Node.js: A Hands-On Guide to Building Web Applications in JavaScript
by Marc Wandschneider
5. Modules
In the Node.js servers and scripts you have written thus far, you have already consumed external functionality in the form of modules. In this chapter, I explain how this all works and how to write your own. In addition to all the already-powerful and functional modules that Node provides for you, there is a huge community further developing modules that you can take advantage of in your programs, and indeed you can even write your own to give something back!
One of the cool things about Node is that you don’t really distinguish between modules that you have produced and modules that you consume from external repositories, such as those you see later in this chapter via npm, the Node Package Manager. When you write separate classes ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access