electron-plugins

Plugin loader for electron applications.

Showing:

Popularity

Downloads/wk

35

GitHub Stars

56

Maintenance

Last Commit

5yrs ago

Contributors

2

Package

Dependencies

2

Size (min+gzip)

4.8KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

electron-plugins

Plugin loader for electron applications.

Installation

npm install electron-plugins --save

Usage

In your electron render process you can load your plugins like so:

var plugins = require('electron-plugins');

document.addEventListener('DOMContentLoaded', function () {
  var context = { document: document };
  plugins.load(context, function (err, loaded) {
    if(err) return console.error(err);
    console.log('Plugins loaded successfully.');
  });
});

Your plugin should export a constructor function, which is passed the context object upon instantiation. You can put whatever you want onto the context object.

function Plugin(context) {
    var d = context.document
    var ul = d.getElementById('plugins')
    var li = d.createElement('li')
    li.innerHTML = 'electron-updater-sample-plugin'
    ul.appendChild(li)
}

module.exports = Plugin

Examples

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial