cards

@motioneffector/cards

A TypeScript library for parsing and writing Character Card V3 and Lorebook data.

npm version license TypeScript

Features

Read the full manual →

Quick Start

import { readCard, writeCardToPng } from '@motioneffector/cards'

// Read from any format (PNG, JSON, or CHARX)
const card = readCard(fileBytes)

// Access card data
console.log(card.data.name)
console.log(card.data.description)

// Write to PNG format
const pngBytes = writeCardToPng(card, imagePngBytes)

// Parse lorebook decorators
import { parseDecorators } from '@motioneffector/cards'
const { decorators, content } = parseDecorators(entry.content)

Testing & Validation

License

MIT © motioneffector