Javascript: appending module scope to a scope other than the global scope

Viewed 13

How do I wrap a module scope created by a script of type module or by an import statement in a scope other than the global scope?

some ascii to better illustrate my question

                                          +--------------+
                                          | global scope |
                                          +--------------+  
                                                 |
                                                 |
                                                 |
                                 +-------------------------------+
                                 |           a scope             |
                                 +-------------------------------+             
                                  /              |             \
                                 /               |              \
                                /                |               \
                      +--------------+  +--------------+  +--------------+          
                      | module scope |  | module scope |  | module scope |
                      +--------------+  +--------------+  +--------------+

instead of this

                                 +-------------------------------+
                                 |           global scope        |
                                 +-------------------------------+             
                                  /              |             \
                                 /               |              \
                                /                |               \
                      +--------------+  +--------------+  +--------------+          
                      | module scope |  | module scope |  | module scope |
                      +--------------+  +--------------+  +--------------+
0 Answers
Related