{"_id":"@abquintic/electron-plugins","_rev":"1-359f9f75e59fbf74742aff2c7924f26e","name":"@abquintic/electron-plugins","description":"Plugin loader for electron applications.","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.1":{"name":"@abquintic/electron-plugins","version":"0.1.1","description":"Plugin loader for electron applications.","keywords":["electron","plugins"],"homepage":"https://github.com/evolvelabs/electron-plugins","bugs":{"url":"https://github.com/evolvelabs/electron-plugins/issues"},"license":"MIT","author":{"name":"Evolve LLC, AB Quintic"},"main":"index.js","repository":{"type":"git","url":"git+https://github.com/dbolack-ab/electron-plugins.git"},"scripts":{"test":"mocha"},"dependencies":{"appdirectory":"^0.1.0","async":"^0.9.0","compare-versions":"^3.1.0"},"devDependencies":{"chai":"^2.3.0","mocha":"^2.2.4","proxyquire":"^1.4.0","sinon":"^1.14.1"},"directories":{"test":"test"},"gitHead":"e8b847126ff632cba1e941775cd517b775f8b3d4","_id":"@abquintic/electron-plugins@0.1.1","_npmVersion":"5.5.1","_nodeVersion":"8.9.4","_npmUser":{"name":"abquintic","email":"dbolack@abquintic.com"},"dist":{"integrity":"sha512-59aYcCkRNE9jVA7ptMW9dCv5bgRu6gEewNdNLPVR2tx+1XtvIuiwY7S1+Mpa5I+2BbdnY+Ba8zPNXvssuvxV0g==","shasum":"f488607f6bd1d1f77681d0fa38aead525ebdb22a","tarball":"https://registry.npmjs.org/@abquintic/electron-plugins/-/electron-plugins-0.1.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDOe5tzqWYLs55gz+5tjywHaIbMXA0vXr+qFKEhVym0yAiEA3328PqyWMuyAjpTbGKgMcGg1CBHflohw+hv+efKwx0w="}]},"maintainers":[{"name":"abquintic","email":"dbolack@abquintic.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/electron-plugins-0.1.1.tgz_1517511865590_0.652693759649992"}}},"readme":"# electron-plugins\nPlugin loader for electron applications.\n\n## Installation\n```\nnpm install electron-plugins --save\n```\n\n## Usage\nIn your electron render process you can load your plugins like so:\n```\nvar plugins = require('electron-plugins');\n\ndocument.addEventListener('DOMContentLoaded', function () {\n  var context = { document: document };\n  plugins.load(context, function (err, loaded) {\n    if(err) return console.error(err);\n    console.log('Plugins loaded successfully.');\n  });\n});\n```\n\nThe context object may take the following additional, optional parameters:\n * pluginPath: String: The path to find plugins. Defaults to ApplicationRoot/plugins\n  * Substitutes:\n  ~ - User home dir per os.homedir() IF first character\n  : - Application Name per package.json IF last character\n  * Examples:\n    ~/.config/: - /home/user/.config/MyApp\n    ~: - /home/usr/MyApp\n * makePluginPath: Boolean: Create the plugin path if it is not found. Defaults to false\n * quiet: Boolean: Do not write to the console. Defaults to false.\n * plugins: An Object of user provided plugins in the format { pluginName: pluginVerionsString } using semvar compatible strings OR LINK for the version.\n\nIf you would prefer to do plugin discovery, you can load using the following:\n\n```\nvar plugins = require('electron-plugins');\n\ndocument.addEventListener('DOMContentLoaded', function () {\n  plugins.discover( '', false, function ( err, results ) {\n    var context = { document: document };\n    if( !err )\n    {\n      context.plugins = results;\n    }\n    plugins.load({context: context}, function (err, loaded) {\n      if(err) return console.error(err);\n        console.log('Plugins loaded successfully.');\n    });\n  });\n});\n```\n\n## About your plugin:\n\nThe default plugin folder location is pulled from the AppDirectory object for the application if not provided by the app.\nInside the plugins folder, your plugin should have  directory matching its name. There should be a subdirectory for each version of the plugin installed, named for the version in semvar compatible format ( example: 0.0.1 ) or LINK for developmental code.\n\nYour plugin will need a package.json. If config.main is not set, it is assumed to be index.js.\n\nYour plugin should export a constructor function, which is passed the context object upon instantiation. You can put whatever you want onto the context object.\n```\nfunction Plugin(context) {\n  alert(\"This plugin loaded!\");\n}\n\nmodule.exports = Plugin\n```\n\n## Examples\n* [electron-updater-sample](https://github.com/EvolveLabs/electron-updater-sample)\n* [electron-updater-sample-plugin](https://github.com/EvolveLabs/electron-updater-sample-plugin)\n\n## Related\n* [electron-updater](https://github.com/EvolveLabs/electron-updater)\n","maintainers":[{"name":"abquintic","email":"dbolack@abquintic.com"}],"time":{"modified":"2022-04-04T11:01:34.558Z","created":"2018-02-01T19:04:26.508Z","0.1.1":"2018-02-01T19:04:26.508Z"},"homepage":"https://github.com/evolvelabs/electron-plugins","keywords":["electron","plugins"],"repository":{"type":"git","url":"git+https://github.com/dbolack-ab/electron-plugins.git"},"author":{"name":"Evolve LLC, AB Quintic"},"bugs":{"url":"https://github.com/evolvelabs/electron-plugins/issues"},"license":"MIT","readmeFilename":"README.md"}