MCPcopy
hub / github.com/requirejs/requirejs

github.com/requirejs/requirejs @2.3.8 sqlite

repository ↗ · DeepWiki ↗ · release 2.3.8 ↗
134 symbols 314 edges 403 files 11 documented · 8%
README

RequireJS

RequireJS loads plain JavaScript files as well as more defined modules. It is optimized for in-browser use, including in a Web Worker, but it can be used in other JavaScript environments, like Rhino and Node. It implements the Asynchronous Module API.

RequireJS uses plain script tags to load modules/files, so it should allow for easy debugging. It can be used simply to load existing JavaScript files, so you can add it to your existing project without having to re-write your JavaScript files.

RequireJS includes an optimization tool you can run as part of your packaging steps for deploying your code. The optimization tool can combine and minify your JavaScript files to allow for better performance.

If the JavaScript file defines a JavaScript module via define(), then there are other benefits RequireJS can offer: improvements over traditional CommonJS modules and loading multiple versions of a module in a page. RequireJS also has a plugin system that supports features like i18n string bundles, and text file dependencies.

RequireJS does not have any dependencies on a JavaScript framework.

RequireJS works in IE 6+, Firefox 2+, Safari 3.2+, Chrome 3+, and Opera 10+.

Latest Release

License

MIT

Code of Conduct

jQuery Foundation Code of Conduct.

Directories

  • dist: Scripts and assets to generate the requirejs.org docs, and for generating a require.js release.
  • docs: The raw HTML files for the requirejs.org docs. Only includes the body of each page. Files in dist are used to generate a complete HTML page.
  • tests: Tests for require.js.
  • testBaseUrl.js: A file used in the tests inside tests. Purposely placed outside the tests directory for testing paths that go outside a baseUrl.
  • updatesubs.sh: Updates projects that depend on require.js Assumes the projects are siblings to this directory and have specific names. Useful to copy require.js to dependent projects easily while in development.

Tests

This repo assumes some other repos are checked out as siblings to this repo:

git clone https://github.com/requirejs/text.git
git clone https://github.com/requirejs/i18n.git
git clone https://github.com/requirejs/domReady.git
git clone https://github.com/requirejs/requirejs.git

So when the above clones are done, the directory structure should look like:

  • domReady
  • i18n
  • text
  • requirejs (this repo)

You will need to be connected to the internet because the JSONP and remoteUrls tests access the internet to complete their tests.

Serve the directory with these 4 siblings from a web server. It can be a local web server.

Open requirejs/tests/index.html in all the browsers, click the arrow button to run all the tests.

Core symbols most depended-on inside this repo

jQuery
called by 61
tests/jquery/scripts/jquery-1.7.1.js
byId
called by 32
tests/doh/_browserRunner.js
getOwn
called by 27
require.js
hasProp
called by 14
require.js
each
called by 13
require.js
bind
called by 13
require.js
makeModuleMap
called by 11
require.js
makeArray
called by 10
tests/jquery/scripts/jquery-1.7.1.js

Shape

Function 134

Languages

TypeScript100%

Modules by API surface

tests/jquery/scripts/jquery-1.7.1.js56 symbols
require.js35 symbols
tests/doh/_browserRunner.js16 symbols
tests/doh/runner.js5 symbols
tests/secondLateConfigPlugin/app/lib_/amd/nonamd.js2 symbols
tests/shim/d.js1 symbols
tests/shim/built/basic-tests.js1 symbols
tests/secondLateConfigPlugin/app/lib_/amd/text.js1 symbols
tests/remoteUrls/jqwrap.js1 symbols
tests/plugins/pluginLast/main.js1 symbols
tests/plugins/indexBuilder.js1 symbols
tests/plugins/index.js1 symbols

Dependencies from manifests, versioned

jscs1.12.0 · 1×
jshint2.7.0 · 1×

For agents

$ claude mcp add requirejs \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact