0.2.0 • Published 4 months ago
@jil/plugin v0.2.0
@jil/plugin
Plugin based architecture that supports module loading, custom types, registries, scopes, and more.
import {Registry, Pluggable} from '@jil/plugin';
export interface Renderable<T> extends Pluggable<T> {
render(): string | Promise<string>;
}
const registry = new Registry<Renderable>('jil', 'plugin', {
validate(plugin) {
if (typeof plugin.render !== 'function') {
throw new TypeError('Plugins require a `render()` method.');
}
},
});
const plugin = await registry.load('jil-plugin-example');
Features
- 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.
Installation
npm i @jil/plugin
Documentation
0.2.0
4 months ago
0.1.20
7 months ago
0.1.19
11 months ago
0.1.18
1 year ago
0.1.17
1 year ago
0.1.14
1 year ago
0.1.15
1 year ago
0.1.16
1 year ago
0.1.12
2 years ago
0.1.13
2 years ago
0.1.11
2 years ago
0.1.10
2 years ago
0.1.8
2 years ago
0.1.7
2 years ago
0.1.9
2 years ago
0.1.4
2 years ago
0.1.6
2 years ago
0.1.5
2 years ago
0.1.3
2 years ago
0.1.2
2 years ago
0.1.1
2 years ago