In the Organizing code in modules section of Chapter 2, Using JavaScript Modern Features, we saw how modern JS works with modules. However, with Node, we have a little setback: it doesn't do modules the modern JS way—unless you are willing to work with experimental features!
Why doesn't Node work with the modern JS modules? The reason harkens back to several years before the new modules with import and export statements existed, and Node implemented the CommonJS module format. (We'll be seeing more about those modules in the next section.) Obviously, libraries meant to be used with Node were also developed using that format, and nowadays there are an uncountable number of modules that follow those guidelines.
However, since the new standard for modules appeared, a pressure began to apply to use the new syntax—but that posed some...