Node.js · Junior · Question 18 of 75

What is the recommended way to import a built-in module?

Explanation

The node: prefix makes it clear the module is built in and cannot be shadowed by a package with the same name in node_modules. Some newer modules, such as node:test, work only with it.

Further reading

Problem with a question

Node.js · Junior · question 18

Test yourself

Take the Node.js · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz