|
|
---|---|
Include.js is a tiny (1,2ko minified and gziped) Javascript loader. It can load normal javascript files or css but is more efficient with web modules. When it's possible, it will use async loading to speed up you page and will ensure the good executions of your script. It support nested dependencies, a useful feature to create clean and flexible javascript application. Include.js was tested on :
|
|
Define modulesIn the old javascript days, to create a module, you would add a simple wrapper on your code, like a auto-called anonymous function |
|
Now, to define a module meeting the AMD standard, just use With AMD definition, you can create module having dependencies realy easily, executing code only when the dependencies are available. |
|
Named modulesModules without a name are automatically named with their file name. This is what makes modules very portable and easily usable in others projetcs. Naming module manually must be avoided to prevent conflicts or loading missing module. Only use module naming in controlled cases or for better performances. |
|
External dependenciesYou can also load external dependencies, useful to speed up website loading time and prevent parsing to be blocked. External dependencies can be AMD module or normal javascripts. If no module is found, argument send to the callback will be the index of the script in the dependencies array instead of the module function. |
|
Load CSSYou can also load css like any other module. The callback will be called when the browser will have parsed the style. |
|
Already using a script loader ?If you already use a script loader you can replace it with Include.js without problemes and without rewriting code. |
|
Download |
|
Developed by
|
|
Include.js is under the MIT License. License |