Node.js · Middle · Question 65 of 75

Can CommonJS code require() an ES module in modern Node.js?

Explanation

require(esm) was added in recent versions, which made mixing module systems much easier. If the module uses top-level await, use dynamic import().

Further reading

Problem with a question

Node.js · Middle · question 65

Test yourself

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

Take this quiz