3 Modules in MediaWiki are based on [JavaScript modules](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Modules) and are provided by
4 [ResourceLoader](https://www.mediawiki.org/wiki/Special:MyLanguage/ResourceLoader/Developing_with_ResourceLoader).
5 Modules are the preferred way to interact with the MediaWiki frontend API.
7 This section documents [stable](https://www.mediawiki.org/wiki/Special:MyLanguage/Stable_interface_policy/Frontend) modules included with MediaWiki core.
8 For information about modules defined by extensions, see the documentation for those extensions.
10 To use a module, load the module asynchronously with `mw.loader`:
13 mw.loader.using( 'moduleName' ).then( ( require ) => {
14 const module = require( 'moduleName' );
19 Or, you can list the module in your extension's [ResourceLoader module](https://www.mediawiki.org/wiki/Special:MyLanguage/ResourceLoader/Developing_with_ResourceLoader#Registering) as a dependency. For example, to use `mediawiki.util`:
25 "localBasePath": "modules/ext.MyExtension",
26 "remoteExtPath": "MyExtension/modules/ext.MyExtension",
39 const module = require( 'mediawiki.util' );
40 module.clearSubtitle();
45 MediaWiki uses the jQuery library. You can access and extend the jQuery object using plugins
46 included with MediaWiki core by loading certain ResourceLoader modules.