@vidhyasagarthakur/core
v0.1.1
Published
Core orchestrator for the DevToolkit plugin ecosystem
Readme
@vidhyasagarthakur/core
Core orchestration package for DevToolkit.
What It Does
- Registers plugins
- Manages lifecycle: INIT -> REGISTER -> SETUP -> START -> RUNNING -> STOP
- Provides shared event bus (
emit/on) - Exposes toolkit logging helpers
Install
pnpm add @vidhyasagarthakur/coreQuick Start
import { createToolkit, type Plugin } from "@vidhyasagarthakur/core";
const helloPlugin: Plugin = {
name: "hello",
setup(ctx) {
ctx.log("setup complete");
},
start() {
console.log("hello start");
},
};
const toolkit = createToolkit({ plugins: [helloPlugin], debug: true });
// later
// toolkit.stop();API
createToolkit(config)new Toolkit(config)Toolkit#setup()Toolkit#start()Toolkit#stop()Toolkit#on(event, cb)Toolkit#emit(event, payload)Toolkit#getLifecycle()Toolkit#getPluginNames()
Types
Plugin<TEvents>ToolkitContext<TEvents>ToolkitConfig<TEvents>EventPayloadMapToolkitLifecycle
License
MIT
