convert()
function convert(
templateBuffer,
sourceBuffer,
options?): Promise<OutputFile[]>;
Defined in: impl/js/src/index.ts:317
Run full conversion: template + source → output files.
Reads the XTL template workbook, applies its directives over the source workbook, and returns one OutputFile per emitted file group.
Parameters
| Parameter | Type |
|---|---|
templateBuffer | ArrayBuffer |
sourceBuffer | ArrayBuffer |
options? | ConvertOptions |
Returns
Promise<OutputFile[]>
Stable
Frozen at 1.0 per spec/STABILITY.md "Public API surface".
Signature changes are 2.0-only.
Examples
const outputs = await convert(templateBuffer, sourceBuffer, {
inputs: { month: '2026-05' },
});
// Enforce a wall-clock budget. On abort the call rejects with
// `xl3/abort/cancelled` and emits no partial output.
const ctrl = new AbortController();
const timer = setTimeout(() => ctrl.abort(), 30_000);
try {
const outputs = await convert(templateBuffer, sourceBuffer, {
signal: ctrl.signal,
});
} finally {
clearTimeout(timer);
}