28 lines
863 B
Markdown
28 lines
863 B
Markdown
# asteroid-module
|
|
v0.0.1
|
|
|
|
## About
|
|
|
|
An `AsteroidModule` is an abstract class that provides a base for all asteroid modules. Its constructor takes an `options` argument provided by a `config.json`. It is also supplied with dependencies it lists on its constructor based on information in the `config.json` file.
|
|
|
|
## Example
|
|
|
|
See [resource](../resource) for an example asteroid module.
|
|
|
|
## AsteroidModule.dependencies
|
|
|
|
An asteroid module may define dependencies on other modules that can be configured in `config.json`. Eg. the [collection](../collection/lib/collection.js) module defines a [model](../model) dependency.
|
|
|
|
Collection.dependencies = {
|
|
model: 'model'
|
|
}
|
|
|
|
A configuration then must define:
|
|
|
|
{
|
|
"dependencies": {
|
|
"model": "some-model-module"
|
|
}
|
|
}
|
|
|
|
Where `some-model-module` is an existing `model` instance. |