npm.io
2.1.3 • Published 6 years ago

bloggify-plugin-class

Licence
MIT
Version
2.1.3
Deps
7
Size
15 kB
Vulns
0
Weekly
0

bloggify-plugin-class

Version Downloads

A library for managing plugin objects.

This module is used internally in plugin loaders.

Installation

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

# Using yarn
yarn add bloggify-plugin-class

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
    // ...
});

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

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.

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

License

MIT Bloggify

Keywords