You are on page 1of 1

• Node.

js and Express
○ A module in JavaScript is just a file containing related code. In
JavaScript, we use the import and export keywords to share and receive
functionalities respectively across different modules. The export keyword is used
to make a variable, function, class or object accessible to other modules.
○ Browsers don't yet support the newest features of JavaScript, and
that is why the code running in the browser must be transpiled with e.g. babel. The
situation with JavaScript running in the backend is different. The newest version
of Node supports a large majority of the latest features of JavaScript, so we can
use the latest features without having to transpile our code.
○ Notice that the applications and exercises in this part are not all
React applications, and we will not use the create-react-app utility for
initializing the project for this application.
○ We had already mentioned npm back in part 2, which is a tool used for
managing JavaScript packages. In fact, npm originates from the Node ecosystem.
○ Simple web server
§ These days, code that runs in the browser uses ES6 modules.
Modules are defined with an export and taken into use with an import.
§ However, Node.js uses so-called CommonJS modules. The reason
for this is that the Node ecosystem had a need for modules long before JavaScript
supported them in the language specification. Node supports now also the use of ES6
modules, but since the support is yet not quite perfect we'll stick to CommonJS
modules.

You might also like