ProcessorsReferenceSDK Reference
SDK Overview
CyanPrint SDK for processor development
SDK Overview
The CyanPrint SDK (@atomicloud/cyan-sdk) provides the APIs for creating processors.
Installation
npm install @atomicloud/cyan-sdk
bun add @atomicloud/cyan-sdk
Core Exports
Entry Points
| Export | Purpose |
|---|---|
StartProcessorWithLambda | Entry point for processors |
Interfaces
| Interface | Description |
|---|---|
ProcessorInput | Input passed to processor |
ProcessorOutput | Return value from processor |
CyanFileHelper | File operations API |
CyanGlob | Glob pattern configuration |
Types
| Type | Description |
|---|---|
VirtualFile | File with content |
VirtualFileReference | File reference (lazy loading) |
VirtualFileStream | Streaming file access |
Quick Start
import { StartProcessorWithLambda } from '@atomicloud/cyan-sdk';StartProcessorWithLambda(async (input, fileHelper) => {// input: ProcessorInput// - readDirectory: Source files location// - writeDirectory: Output location// - globs: File patterns to process// - config: Configuration from template// fileHelper: CyanFileHelper// - resolveAll(): Load all files// - read(glob): Load specific files// - get(glob): Get file references// - readAsStream(glob): Stream files// - copy(glob): Copy files directlyconst files = fileHelper.resolveAll();files.forEach(file => {file.content = transform(file.content);file.writeFile();});return { directory: input.writeDirectory };});
SDK Reference Sections
StartProcessorWithLambda
Entry point API for processors
CyanFileHelper
File operations API
Input/Output
Type definitions
Types
Full type reference
Version Compatibility
| SDK Version | CyanPrint CLI | Runtime |
|---|---|---|
| 1.x | 1.x | Node.js 18+ |
| 2.x | 2.x | Node.js 20+ / Bun |