Skip to main content

API Overview

xlmake's API is divided into two main parts.

Entry Points

xlmake()

Creates a builder for generating Excel files.

import { xlmake } from "xlmake";

const builder = xlmake();

read()

Reads existing Excel files.

import { read } from "xlmake";

const workbook = await read("report.xlsx");

Method Reference

WorkbookBuilder / SheetBuilder

MethodReturnsDescription
sheet(name?)SheetBuilderAdd sheet (auto-generated name if omitted)
table(options)thisAdd table
text(input)thisAdd text
image(options)thisAdd image
space(lines?)thisAdd empty rows (default: 1)
getNode()Promise<NodeOutput>Get Node.js output object
getBrowser()Promise<BrowserOutput>Get browser output object

NodeOutput

MethodReturnsDescription
saveToFile(path)Promise<void>Save to file
toBuffer()Promise<Buffer>Get as Buffer

BrowserOutput

MethodReturnsDescription
download(filename)Promise<void>Download file

Basic Flow

xlmake() → sheet() → table() / text() / image() → getNode() / getBrowser()
const output = await xlmake()
.sheet("Sheet Name")
.table({ columns: [...], data: [...] })
.getNode();

await output.saveToFile("output.xlsx");

Next Steps