Key Concepts

Review core concepts you need to learn to master this subject

Import Javascript modules with the require function

var moduleA = require( "./module-a.js" ); // The .js extension is optional var moduleA = require( "./module-a" ); // Both ways will produce the same result. // Now the functionality of moduleA can be used console.log(moduleA.someFunctionality)

In Node.js, the require function can used to import code from another file into the current script.

Intermediate JavaScript Modules
Lesson 1 of 1

What you'll create

Portfolio projects that showcase your new skills

Pro Logo

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo