Skip to content

Report Generation

Form 8949 (CSV)

import { computeGains, generateForm8949Csv } from '@dtax/tax-engine';
const result = computeGains(transactions, { method: 'FIFO', taxYear: 2024 });
const csv = generateForm8949Csv(result.disposals, { taxYear: 2024 });
// Returns RFC 4180 CSV string ready to import into tax software

TXF export

TXF (Tax Exchange Format) is supported by TurboTax, H&R Block, and TaxAct:

import { generateTxfFile } from '@dtax/tax-engine';
const txf = generateTxfFile(result.disposals, { taxYear: 2024 });
// Returns TXF string — save as .txf and import into your tax software

Schedule D summary

const { scheduleD } = result;
console.log(`Short-term net: $${scheduleD.shortTermNet}`);
console.log(`Long-term net: $${scheduleD.longTermNet}`);