Skip to main content
Glama

vulcan-file-ops

docx-writer.ts1.16 kB
import { Document, Packer, Paragraph, TextRun } from "docx"; export interface CreateDOCXOptions { title?: string; subject?: string; creator?: string; keywords?: string[]; description?: string; } /** * Create simple DOCX from plain text content * This is the main function called by write_file tool */ export async function createSimpleDOCX( content: string, options: CreateDOCXOptions = {} ): Promise<Buffer> { // Split content into paragraphs by newlines const lines = content.split("\n"); // Create paragraphs from each line const paragraphs = lines.map( (line) => new Paragraph({ children: [new TextRun(line || " ")], // Use space for empty lines to preserve spacing }) ); // Create document with metadata const doc = new Document({ creator: options.creator || "vulcan-file-ops", title: options.title, subject: options.subject, keywords: options.keywords?.join(", "), description: options.description, sections: [ { properties: {}, children: paragraphs, }, ], }); // Convert to buffer return Buffer.from(await Packer.toBuffer(doc)); }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/n0zer0d4y/vulcan-file-ops'

If you have feedback or need assistance with the MCP directory API, please join our Discord server