May 2018
Intermediate to advanced
492 pages
12h 3m
English
ES6 modules do not cover all the requirements to fully replace Node.js/CommonJS modules. One of the missing capabilities is being addressed with the Dynamic Import feature currently on its way through the TC-39 committee.
Support for dynamic imports landed in Node.js 9.7. See the documentation at: https://github.com/tc39/proposal-dynamic-import.
We'll use dynamic imports to solve an issue in Chapter 7, Data Storage and Retrieval, about dynamically choosing the module to load. In normal usage of the require() statement, can use a simple string literal to specify the module name. But it is also possible to use a string literal to compute the module name, like so:
// Node.js dynamically determined module loading ...
Read now
Unlock full access