July 2018
Beginner
100 pages
2h 7m
English
Like most programming languages, Node.js uses modules as a way of organizing code. The module system allows you to organize your code, hide information, and only expose the public interface of a component using module.exports.
Node.js uses the CommonJS specification for its module system:
Let's look at a simple example:
// math.js filefunction add(a, b) { return a + b;}……module.exports = ...Read now
Unlock full access