@flowforgejs/shared
v0.1.4
Published
Shared types, utilities, and constants for FlowForge
Downloads
338
Readme
@flowforgejs/shared
Shared types, error classes, and constants used across the FlowForge monorepo. This package provides the foundational type system that all other packages depend on.
Key exports: NodeDefinition, NodeContext, RunRecord, WorkflowDefinition, FlowForgeError, NodeExecutionError, ValidationError
Install
npm install @flowforgejs/sharedQuick Example
import type { NodeDefinition, NodeContext, WorkflowDefinition } from '@flowforgejs/shared';
import { NodeExecutionError } from '@flowforgejs/shared';
// Use shared types when building a custom node
const myNode: NodeDefinition = {
name: 'custom-node',
category: 'tools',
async run(ctx: NodeContext) {
if (!ctx.input.data) {
throw new NodeExecutionError('custom-node', 'Missing required data');
}
return { result: ctx.input.data };
},
};