CommonJSModuleProvider
Common JS Module Provider
Augments the JSModuleProvider interface with support infrastructure for synthetic CommonJS imports; in this case, modules are rendered to strings, which are loaded through a synthetic TruffleFile. This is useful for making built-in modules accessible via a single and uniform interface through both ESM and CJS.
When importing an ESM module, the ElideJsModuleRouter will call in to pre-render the Truffle file and inject it into the module cache. This allows ESM and CJS to behave interchangeably: it should not matter which module system is used first to load a built-in, as the result will be the same (a generated Truffle file is loaded for CJS and injected into the cache, and, as applicable, a synthetic module is returned directly for use in ESM contexts).