bloggify-plugin-loader
v2.1.2
Published
The Bloggify plugin loader.
Downloads
8
Readme
bloggify-plugin-loader
The Bloggify plugin loader.
This is the default plugin loader for Bloggify.
:cloud: Installation
# Using npm
npm install --save bloggify-plugin-loader
# Using yarn
yarn add bloggify-plugin-loader
:question: Get Help
There are few ways to get help:
- Please post questions on Stack Overflow. You can open issues with questions, as long you add a link to your Stack Overflow question.
- For bug reports and feature requests, open issues. :bug:
:memo: Documentation
bloggifyPluginLoader(bloggify)
BloggifyPluginLoader The Bloggify plugin loader.
Params
- BloggifyCore
bloggify
: TheBloggifyCore
instance.
Return
- BloggifyPluginLoader The
BloggifyPluginLoader
instance.
getPluginPath(pluginName)
Fetches the plugin's path.
Params
- BloggifyPlugin
pluginName
: The plugin's name.
Return
- String The plugin's path.
namesToPaths(names)
Fetches the path list for each plugin.
Params
- Array
names
: The list of plugin names.
Return
- Array The path list.
listPluginDirs(names, cb)
Fetches the list of the plugin's instances.
Params
- Array
names
: The list of plugin names. - Function
cb
: The callback function.
getPlugin(plugin)
Fetches called plugin's content if it's valid. Otherwise, it fetches a new one.
Params
- BloggifyPlugin
plugin
: The plugin's name.
Return
- BloggifyPlugin|String The plugin's name or instance.
listPlugins(names, cb)
Fetches the plugins list.
Params
- Array
names
: The list of plugin names. - Function
cb
: The callback function.
initPlugin(plug, cb)
Initializes the plugin's instance.
Params
- BloggifyPlugin
plug
: The plugin instance. - Function
cb
: The callback function.
loadAll(names, cb)
Initializes the plugins that need to be loaded.
Params
- Array
names
: The list of plugin names. - Function
cb
: The callback function.
Return
- Promise A promise.
loadPlugin(plugin, cb)
Loads the provided plugin.
Params
- BloggifyPlugin
plugin
: The plugin instance. - Function
cb
: The callback function.
get(name, mod)
If true
, the raw plugin module will be returned. Otherwise, it will fetch the instance of the plugin.
Params
- String
name
: The plugin's name. - Boolean
mod
: The plugin's module. Default:true
Return
- BloggifyPlugin|String The plugin's name or instance.
:yum: How to contribute
Have an idea? Found a bug? See how to contribute.
:dizzy: Where is this library used?
If you are using this library in one of your projects, add it in this list. :sparkles:
bloggify