npm.io
2.1.2 • Published 6 years ago

bloggify-plugin-loader

Licence
MIT
Version
2.1.2
Deps
5
Size
15 kB
Vulns
0
Weekly
0
Stars
2

bloggify-plugin-loader

Version Downloads

The Bloggify plugin loader.

This is the default plugin loader for Bloggify.

Installation

# Using npm
npm install --save bloggify-plugin-loader

# Using yarn
yarn add bloggify-plugin-loader

Get Help

There are few ways to get help:

  1. Please post questions on Stack Overflow. You can open issues with questions, as long you add a link to your Stack Overflow question.
  2. For bug reports and feature requests, open issues.

Documentation

bloggifyPluginLoader(bloggify)

BloggifyPluginLoader The Bloggify plugin loader.

Params
  • BloggifyCore bloggify: The BloggifyCore 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.

How to contribute

Have an idea? Found a bug? See how to contribute.

Where is this library used?

If you are using this library in one of your projects, add it in this list.

  • bloggify

License

MIT Bloggify

Keywords