8000 gemini/doc/plugins.md at v0.12.2 · gemini-testing/gemini · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Sep 21, 2022. It is now read-only.

Latest commit

 

History

History
35 lines (27 loc) · 806 Bytes

plugins.md

File metadata and controls

35 lines (27 loc) · 806 Bytes

Writing plugins

Gemini plugin is just an npm package with a gemini-<plugin name> name. Module should export a single function which receives Gemini class instance and user-specified options. For example:

module.exports = function(gemini, options) {
    console.log('Hello from plugin');
};

Documentation on the gemini object can be found in programmatic API document.

Options are specified by a user in a config file and passed to the plugin as is. For example:

.gemini.yml:

plugins:
  greeter:
    name: Mr. Incredible 

Plugin:

module.exports = function(gemini, options) {
    console.log('Hello, %s' options.name);
};

When publishing plugins, add gemini-plugin keyword to your package.json to help users discovering it.

0