<commit_before># API

- [SitemapStream](#sitemapstream)
- [XMLToSitemapOptions](#XMLToSitemapOptions)
- [sitemapAndIndexStream](#sitemapandindexstream)
- [createSitemapsAndIndex](#createsitemapsandindex)
- [SitemapIndexStream](#SitemapIndexStream)
- [xmlLint](#xmllint)
- [parseSitemap](#parsesitemap)
- [lineSeparatedURLsToSitemapOptions](#lineseparatedurlstositemapoptions)
- [streamToPromise](#streamtopromise)
- [ObjectStreamToJSON](#objectstreamtojson)
- [SitemapItemStream](#SitemapItemStream)
- [Sitemap Item Options](#sitemap-item-options)
- [SitemapImage](#sitemapimage)
- [VideoItem](#videoitem)
- [LinkItem](#linkitem)
- [NewsItem](#newsitem)

### SitemapStream

A [Transform](https://nodejs.org/api/stream.html#stream_implementing_a_transform_stream) for turning a [Readable stream](https://nodejs.org/api/stream.html#stream_readable_streams) of either [SitemapItemOptions](#sitemap-item-options) or url strings into a Sitemap. The readable stream it transforms **must** be in object mode.

```javascript
const { SitemapStream } = require('sitemap')
const sms = new SitemapStream({
  hostname: 'https://example.com', // optional only necessary if your paths are relative
  lastmodDateOnly: false // defaults to false, flip to true for baidu
  xmlNS: { // XML namespaces to turn on - all by default
    news: true,
    xhtml: true,
    image: true,
    video: true,
    // custom: ['xmlns:custom="https://example.com"']
  }
})
const readable = // a readable stream of objects
readable.pipe(sms).pipe(process.stdout)<commit_msg>updated api.md removing capital letters from sitemapstream API snippet<commit_after># API

- [SitemapStream](#sitemapstream)
- [XMLToSitemapOptions](#XMLToSitemapOptions)
- [sitemapAndIndexStream](#sitemapandindexstream)
- [createSitemapsAndIndex](#createsitemapsandindex)
- [SitemapIndexStream](#SitemapIndexStream)
- [xmlLint](#xmllint)
- [parseSitemap](#parsesitemap)
- [lineSeparatedURLsToSitemapOptions](#lineseparatedurlstositemapoptions)
- [streamToPromise](#streamtopromise)
- [ObjectStreamToJSON](#objectstreamtojson)
- [SitemapItemStream](#SitemapItemStream)
- [Sitemap Item Options](#sitemap-item-options)
- [SitemapImage](#sitemapimage)
- [VideoItem](#videoitem)
- [LinkItem](#linkitem)
- [NewsItem](#newsitem)

### SitemapStream

A [Transform](https://nodejs.org/api/stream.html#stream_implementing_a_transform_stream) for turning a [Readable stream](https://nodejs.org/api/stream.html#stream_readable_streams) of either [SitemapItemOptions](#sitemap-item-options) or url strings into a Sitemap. The readable stream it transforms **must** be in object mode.

```javascript
const { SitemapStream } = require('sitemap')
const sms = new SitemapStream({
  hostname: 'https://example.com', // optional only necessary if your paths are relative
  lastmodDateOnly: false // defaults to false, flip to true for baidu
  xmlns: { // XML namespaces to turn on - all by default
    news: true,
    xhtml: true,
    image: true,
    video: true,
    // custom: ['xmlns:custom="https://example.com"']
  }
})
const readable = // a readable stream of objects
readable.pipe(sms).pipe(process.stdout)
{'fraction_non_alphanumeric': 0.13437599744653686, 'fraction_numerical': 0.0, 'mean_word_length': 6.026905829596412, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5223605', 'n_tokens_mistral': 1065, 'n_tokens_neox': 1014, 'n_words': 211}