Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
gardr-core-plugin
Advanced tools
The PluginApi and pluginHandler used for both host and ext side plugin functionality
The PluginApi and pluginHandler used for both host and ext side plugin functionality. It has no dependencies to Garðr or any other libraries.
To make plugins decoupled from the Garðr-code we have plugins as a
pub-sub. They are triggered syncronously, so plugins
can change the object that is passed along. In Garðr we use event names like: "{object}:{event}". For instance
"params:parsed" is triggered right after we've parsed the parameters from the URL in gardr-ext. The params object is
passed as the event data. If a plugin needs to change the script URL before it's written, it can just change the value
of params.url
. Also "item:afterrender" is triggered after an item (banner) has finished loading, and the
item object is passed as the event data.
This module exposes two objects:
var pluginCore = require('gardr-plugin-core');
pluginCore.PluginApi; // the API-object constructor
pluginCore.pluginHandler; // used to register and initialize plugins
It works by exposing a metod that pass plugins to pluginHandler.register. Then call pluginHandler.initPlugins with a new instance of PluginApi and the options object (if they need it).
var pluginApi;
module.exports = {
plugin: function (pluginFn) {
pluginCore.pluginHandler.register(pluginFn);
},
init: function (options) {
pluginApi = new pluginCore.PluginApi();
pluginCore.pluginHandler.initPlugins(pluginApi, options);
}
};
Plugin functions have two parameters; pluginApi and options (same options as above).
module.exports = function (pluginApi, options) {
// Could check options for plugin configuration or read/change the main module´s options
pluginApi.on('eventname', function (obj) {
obj.foo = 'bar';
});
};
To trigger events:
var obj = {foo: null};
pluginApi.trigger('eventname', obj);
console.log( obj.foo ); // 'foo'
FAQs
The PluginApi and pluginHandler used for both host and ext side plugin functionality
The npm package gardr-core-plugin receives a total of 4 weekly downloads. As such, gardr-core-plugin popularity was classified as not popular.
We found that gardr-core-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.