code: public Require createRequire(Context cx, Scriptable globalScope) {
          return new Require(cx, globalScope, moduleScriptProvider, preExec,
                  postExec, sandboxed);
      }
docs: Creates a new require() function. You are still responsible for invoking
  either {@link Require#install(Scriptable)} or
  {@link Require#requireMain(Context, String)} to effectively make it
  available to its JavaScript program.
  @param cx the current context
  @param globalScope the global scope containing the JS standard natives.
  @return a new Require instance.