/
Dependency Descriptor Object
This AI is still in early stages of development.
Dependency Descriptor Object
Aubergine
Owned by Aubergine
Define one or more dependencies for your script...
Object structure
The object uses name:value pairs to define dependencies. The name is a script name, enclosed in quotes, the value is the version number or a Check.ANY_VERSION or Check.NOT_LOADED constant.
Example
var dependencies = { "foo.js": 1.2, // require v1.2 of foo.js "Util.js": Check.ANY_VERSION, // require any version of Util.js "bar.js": Check.NOT_LOADED // require that bar.js isn't loaded }
Which functions can it be used with?
The descriptor can be used with the following functions:
- Check.required() – will throw an error if dependencies are not met
- Check.doWhen() – will wait until dependencies are met then perform specified task
Contents
Jump to:
Dependency Checking
Topics:
- Tricks for including files — Some tricks with the include() function...
- Dependency Descriptor Object — Define one or more dependencies for your script...
- Check() — Perform a soft-check to see if a dependency is available...
- Check.basePath — The base path to the folder that contains the APIs folder...
- Check.paths[] — Define one or more folder paths to enable autoloading...
- Check.doWhen() — Perform a task when dependencies become available.
- Check.has() — Check if a dependency is available, try and load it if not, return availability state...
- Check.LAZY_LOAD — Disable autoloading during a dependency check...
- Check.required() — Thrown a descriptive error if dependency check fails...
- Check.NOT_LOADED — Indicates a script is not yet loaded, or must not be loaded, depending on the Check function being used...
- Check.ANY_VERSION — Skip version checking for a dependency check...
- Check.provide() — Indicate a file is now available.
- Check.versionOf() — Check the version of a dependency.
- Self Descriptor Object — Define the filename and version of your script...