bloggify-plugin-class

A library for managing plugin objects.

Usage no npm install needed!

<script type="module">
  import bloggifyPluginClass from 'https://cdn.skypack.dev/bloggify-plugin-class';
</script>

README

bloggify-plugin-class

Version Downloads

A library for managing plugin objects.

This module is used internally in plugin loaders.

:cloud: Installation

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

# Using yarn
yarn add bloggify-plugin-class

:clipboard: Example

var BloggifyPluginClass = require("bloggify-plugin-class");

// Create a new plugin
var myPlugin = new BloggifyPlugin("foo", "path/to/foo");

// And initialize it
myPlugin.init(function (err, data) {
    // Do something after initialization
    // ...
});

:question: 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. :bug:

:memo: Documentation

BloggifyPlugin

Creates a new Bloggify plugin instance.

Params

  • String name: The plugin name.
  • String pluginPath: The plugin path.
  • Bloggify bloggifyInstance: The Bloggify instance.

Return

  • BloggifyPlugin The BloggifyPlugin instance containing:
  • name (String): The plugin's name.
  • path (String): The path to the plugin's directory.
  • packagePath (String): The path to the plugin's package.json file.
  • bloggify (Bloggify): The Bloggify instance.
  • config (Object): The plugin's configuration.

getFilePath(fileName)

Returns the path of the searched file.

Params

  • String fileName: The name of the file who's path is being searched.

Return

  • String The file's path.

init(cb)

Initializes the plugin.

Params

  • Function cb: The callback function.

getConfig()

Returns plugin's configuration.

Return

  • Object The configuration content.

getPackage(cb)

Returns the plugin's package file.

Params

  • Function cb: The callback function.

Return

  • Object The package contents.

: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-plugin-loader

:scroll: License

MIT © Bloggify