Skip to content

Commit

Permalink
fix README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
somnicattus committed Sep 29, 2024
1 parent 5a7e9e5 commit 6e770e2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,6 @@ Loads one or more functions asynchronously.

The function **must** have the signature: `instance, options, done`

However, if the function returns a `Promise` (i.e. `async`), the above function signature is not required.

Plugin example:
```js
function plugin (server, opts, done) {
Expand All @@ -161,8 +159,11 @@ function plugin (server, opts, done) {

app.use(plugin)
```
`done` should be called only once, when your plugin is ready to go. Additional
calls to `done` are ignored.
`done` should be called only once, when your plugin is ready to go. Additional calls to `done` are ignored.

If your plugin is ready to go immediately after the function is evaluated, you can omit `done` from the signature.

If the function returns a `Promise` (i.e. `async`), the above function signature is not required.

`use` returns a thenable wrapped instance on which `use` is called, to support a chainable API that can also be awaited.

Expand Down

0 comments on commit 6e770e2

Please sign in to comment.