ekalinin/sitemap.js

[question] Readable sitemap

jbaubree opened this issue · 1 comments

Hi, thanks for the work on this project.

I may did not understand something; this code works and generate me a sitemap file.

const stream = new SitemapStream()
const writeStream = createWriteStream(getPath)

sitemapLinks.forEach(item => stream.write(item))
stream.readable = true
stream.pipe(writeStream)
stream.end()

My problem now is that the sitemap.xml is on single line.

How can i get a readable file with indent and code formatting for my xml?
Thanks in advance for help

FYI, i'm using xml-formatter to get formatted sitemap file.
Example here: https://github.com/jbaubree/sitemap-ts/