It's an old question with an accepted answer, but I feel that one should mention that module namespaces are nevertheless supported to some extent. As was already noted by the comment of @rgajrawala , an import of all exported variables from a module via "*" always creates such a namespace. (see here on MDN)
import * as Namespace from "./myModule.js";
console.log(Namespace.default); // in the OP, Pikachu is exported as default
//console.log(Namespace.Pikachu); // if Pikachu wasn't exported as default
Similarly, dynamic imports always return a Promise for a module-namespace:
const Namespace = await import("./myModule.js");
console.log(Namespace.default);
//console.log(Namespace.Pikachu);
For more details on what kind of object such a namespace is, see this SO answer
A third alternative (in general not preferable, see comments to this answer) is to create a namespace already in the module and make it the default export:
// within "./myModule.js"
export default {Pikachu, otherVariable, ...};
// within the other module
import Namespace from "./myModule.js";
console.log(Namespace.Pikachu);
Pikachu
property, as always. But why would you do that, instead of letting the userimport … from '…/pikachu'
whatever and in whichever way he chooses? – Cripps