stable
xml
XML export with RFC-compliant entity escaping, for legacy systems and banking batch imports.
@noy-db/as-xml·pnpm add @noy-db/as-xmlDecrypts records and formats them as XML.
What it does
as-xml targets legacy systems, banking batch imports, SOAP endpoints,
and accounting software that requires XML rather than JSON. The writer
is dependency-free and RFC-compliant on entity escaping, with optional
namespaces, custom root/record element names, and pretty-printing. The
symmetric decoder parses XML back into an import plan using
fast-xml-parser in strict mode.
Usage
import { asXml } from '@noy-db/as-xml'
const xml = await vault.export(asXml(), { collections: ['invoices'] })
import { asXml } from '@noy-db/as-xml'
const plan = await vault.import(asXml(), xml, { collection: 'invoices' })
// → AsXMLImportPlan { plan: VaultDiff, policy: 'merge', apply() }
await plan.apply()
See also
- as-* family
- json — structured alternative
- csv — spreadsheet-friendly alternative