API Documentation for microplugin
MicroPlugin
MicroPlugin
Kind: global class
new MicroPlugin(items, items)
Keep code modularized & extensible. MicroPlugin is a lightweight drop-in plugin architecture for your JavaScript library. Plugins can declare dependencies to other plugins and can be initialized with options (in a variety of formats).
Param | Type |
---|---|
items | array | object |
items | object |
MicroPlugin.Interface.plugins
Kind: static property of MicroPlugin
MicroPlugin.Interface#initializePlugins(plugins)
Initializes the listed plugins (with options). Acceptable formats:
- List (without options): -
['a', 'b', 'c']
- List (with options): -
[{'name': 'a', options: {}}, {'name': 'b', options: {}}]
- Hash (with options): -
{'a': { ... }, 'b': { ... }, 'c': { ... }}
Kind: static method of MicroPlugin
Param | Type |
---|---|
plugins | mixed |
MicroPlugin.Interface#loadPlugin(name)
Loads a plugin.
Kind: static method of MicroPlugin
Param | Type | Description |
---|---|---|
name | string | The name of the plugin to load. |
MicroPlugin.Interface#require(name)
Initializes a plugin.
Kind: static method of MicroPlugin
Param | Type |
---|---|
name | string |
MicroPlugin.Interface.define(name, fn)
Registers a plugin.
Kind: static method of MicroPlugin
Param | Type |
---|---|
name | string |
fn | function |