You can use plugins by simply passing them to the generate method (e.g. [`peg.generate(grammar, { plugins: [plugin1, plugin2, etc] })`](./javascript-api.md#peggenerategrammar-options)).
#### Creating a Plugin
Plugins are expected to be an object that contains at least one method: `use( session, options )`
-`session` - See the docs for [peg.compiler.Session](./javascript-api.md#new-pegcompilersessionoptions)
-`options` - see the docs for [`peg.generate`](./javascript-api.md#peggenerategrammar-options) and [`peg.compiler.compile`](./javascript-api.md#pegcompilercompileast-session-options)