Skip to content

05. Dynamic modules

poseidonCore edited this page May 8, 2016 · 1 revision

######RATIONALE
NodalRequire has an advanced capacity to dynamically define and register modules with NodalRequire.requireAsync.

At first glance, these should be done synchronously because the definition is provided by code itself, but because the code is scanned for requirements and some of these requirements may have to be fetched, the process is relegated to an asynchronous operation.

I may provide a synchronous option later to allow all code to be completed inline.

Also, NodalRequire.requireAsync will currently accept just one definition at a time. This may change later.

NodalRequire.requireAsync currently automatically initialises any newly defined dynamic module. This may change later.

Clone this wiki locally