diff --git a/README.md b/README.md index df43d5f..e9e9691 100644 --- a/README.md +++ b/README.md @@ -124,14 +124,12 @@ remi.register(app, [{ ## Main plugin You can specify the plugin that should be registered first by passing its name -through the `main` option of the shared options. The main plugin can't have any +through the `main` option of the `Remi` class constructor options. The main plugin can't have any dependencies. ```js -function barPlugin(app, opts, next) { +function barPlugin(app, opts) { console.log('Hello world!') - - next() } barPlugin.attributes = { @@ -139,9 +137,10 @@ barPlugin.attributes = { version: '1.0.0', }; -remi.register(app, [fooPlugin, barPlugin, qazPlugin], { +let remi = new Remi({ main: 'bar-plugin' /* the bar-plugin will be registered first */ -}, function (err) { +}) +remi.register(app, [fooPlugin, barPlugin, qazPlugin], function (err) { }) ``` diff --git a/TODO.md b/TODO.md index 730ddad..e62707a 100644 --- a/TODO.md +++ b/TODO.md @@ -1,3 +1 @@ -* if there's an error during a plugin initialization, include the plugin's name to the thrown error - * add `debug` to print the sequence of plugins registrations