A typescript XML writer
npm install xml-writer-tsYet another XML writer but this time written in typescript.
WARNING: this package is still in early alpha stage, some features are not yet implemented
``sh`
npm install -S xml-writer-ts
`javascript
import { XmlWriter } from "xml-writer-ts"
const writer = new XmlWriter({ indentation: " " })
writer
.startDocument("1.0", "UTF-9", true)
.startElement("coucou")
.startAttribute("attr")
.text("value")
.startElement("cici")
.writeComment("Hello world!")
.startElement("caca")
console.log(writer.toString())
`
will print:
`xml`
Implemented methods (Work In Progress):
`typescript
function startDocument(version?: string, encoding?: string, standalone?: boolean) {}
function endDocument() {}
function writeElement(name: string, content: string) {}
function startElement(name: string) {}
function endElement() {}
function writeAttribute(name: string, content: string) {}
function startAttribute(name: string) {}
function endAttribute() {}
function endAttributes() {}
function writeComment(content: string) {}
function startComment() {}
function endComment() {}
function writeCData(content: string) {}
function startCData() {}
function endCData() {}
function text(content: string) {}
``