Plugin based architecture that supports module loading, custom types, registries, scopes, and more.
npm install @boost/pluginPlugin based architecture that supports module loading, custom types, registries, scopes, and more.
``ts
import { Registry, Pluggable } from '@boost/plugin';
export interface Renderable
render(): string | Promise
}
const registry = new Registry
validate(plugin) {
if (typeof plugin.render !== 'function') {
throw new TypeError('Plugins require a render() method.');
}
},
});
const plugin = await registry.load('boost-plugin-example');
`
- Custom plugin types and registries.
- Node module, file path, and configuration file loading strategies.
- Multiple module name formats: public, scoped public, scoped private.
- Structural contracts with life cycle events.
- Factory function pattern for plugin creation.
- Asynchronous by default.
```
yarn add @boost/plugin
- https://boostlib.dev/docs/plugin
- https://boostlib.dev/api/plugin