plugin-interface 1.0.5
Install from the command line:
Learn more about npm packages
$ npm install @opendexcom/plugin-interface@1.0.5
Install via package.json:
"@opendexcom/plugin-interface": "1.0.5"
About this version
Shared interface definitions for FormulAI plugins. This package ensures consistency across all plugins in the FormulAI ecosystem.
npm install @opendexcom/plugin-interfaceImplement the FormulAIPlugin interface in your plugin class:
import { DynamicModule, INestApplication } from '@nestjs/common';
import { FormulAIPlugin } from '@opendexcom/plugin-interface';
export class MyPlugin implements FormulAIPlugin {
name = 'my-plugin';
version = '1.0.0';
description = 'My awesome plugin';
async register(): Promise<DynamicModule> {
return {
module: MyPluginModule,
imports: [],
providers: [],
exports: [],
};
}
async onApplicationBootstrap(app: INestApplication): Promise<void> {
// Optional: Setup middleware, global filters, etc.
}
}The core interface that all plugins must implement.
| Property/Method | Type | Description |
|---|---|---|
name |
string |
Unique name of the plugin |
version |
string |
Semantic version of the plugin |
description |
string |
(Optional) Brief description |
register() |
() => DynamicModule | Promise<DynamicModule> |
Returns the NestJS module to be imported |
onApplicationBootstrap |
(app: INestApplication) => Promise<void> |
(Optional) Lifecycle hook called after app bootstrap |
onApplicationShutdown |
() => Promise<void> |
(Optional) Lifecycle hook called on shutdown |
Configuration structure for plugins.
export interface PluginConfig {
enabled: boolean;
options?: Record<string, any>;
}Details
- plugin-interface
-
opendexcom
- 5 months ago
- MIT
- 4 dependencies
Assets
- plugin-interface-1.0.5.tgz
Download activity
- Total downloads 0
- Last 30 days 0
- Last week 0
- Today 0