LogoCyanPrint
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

ExportPurpose
StartProcessorWithLambdaEntry point for processors

Interfaces

InterfaceDescription
ProcessorInputInput passed to processor
ProcessorOutputReturn value from processor
CyanFileHelperFile operations API
CyanGlobGlob pattern configuration

Types

TypeDescription
VirtualFileFile with content
VirtualFileReferenceFile reference (lazy loading)
VirtualFileStreamStreaming 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 directly
const files = fileHelper.resolveAll();
files.forEach(file => {
file.content = transform(file.content);
file.writeFile();
});
return { directory: input.writeDirectory };
});

SDK Reference Sections

Version Compatibility

SDK VersionCyanPrint CLIRuntime
1.x1.xNode.js 18+
2.x2.xNode.js 20+ / Bun