$ node Welcome to Node.js v14.4.0. Type ".help" for more information. > let myModule; undefined > import("./my-module.js").then(module => { myModule = module }); Promise { <pending> } > myModule.foo(); "bar"