@villedemontreal/workit-core
v7.0.3
Published
This package provides default and no-op implementations of the WorkIt types for client packages.
Readme
WorkIt Core
This package provides default and no-op implementations of the WorkIt types for client packages.
npm i @villedemontreal/workit-core🔌 Plugin System
WorkIt Core includes a powerful plugin system that allows you to extend worker functionality without modifying the core code. Plugins use dependency injection for seamless integration.
Key Features
- Extensible architecture - Add custom functionality through plugins
- Dynamic loading - Enable/disable plugins at runtime
- IoC integration - Full access to the dependency injection container
- Lifecycle management - Automatic plugin loading/unloading
- Configuration support - Flexible plugin configuration
Quick Example
// Create a custom plugin
export class MyPlugin extends BasePlugin {
public readonly moduleName = 'my-plugin';
protected bind(): void {
// Register your services in the IoC container
this._ioc.bindTo(MyService, 'myService', new MyService());
}
protected unbind(): void {
this._ioc.unbind('myService');
}
}
// Configure and load plugins
const plugins: IPlugins = {
'my-plugin': {
enabled: true,
path: './my-plugin'
}
};
const pluginLoader = new PluginLoader(IoC, logger);
pluginLoader.load(plugins);Documentation & Examples
- 📖 Complete Plugin Guide - Comprehensive documentation with API reference
- 🚀 Metrics Plugin Example - Full working example with metrics collection
- 🧪 Plugin Tests - Test examples and usage patterns
Useful links
- Get started in 2 minutes.
- Documentation is available in this folder
- Comprehensive API documentation is available online and in the
docssubdirectory
