@robinpath/sitemap
v0.1.1
Published
XML sitemap generation, parsing, validation, and manipulation with image/video/alternate support
Downloads
134
Readme
@robinpath/sitemap
XML sitemap generation, parsing, validation, and manipulation with image/video/alternate support
Why use this module?
The sitemap module lets you:
- Create XML sitemap
- Create sitemap index
- Parse XML sitemap
- Parse sitemap index
- Add URL to sitemap XML
All functions are callable directly from RobinPath scripts with a simple, consistent API.
Installation
npm install @robinpath/sitemapQuick Start
No credentials needed — start using it right away:
sitemap.createIndex [{"loc": "https://example.com/sitemap1.xml"}]Available Functions
| Function | Description |
|----------|-------------|
| sitemap.create | Create XML sitemap |
| sitemap.createIndex | Create sitemap index |
| sitemap.parse | Parse XML sitemap |
| sitemap.parseIndex | Parse sitemap index |
| sitemap.addUrl | Add URL to sitemap XML |
| sitemap.removeUrl | Remove URL from sitemap XML |
| sitemap.filterByChangefreq | Filter URLs by change frequency |
| sitemap.filterByPriority | Filter URLs by priority range |
| sitemap.sortByPriority | Sort URLs by priority |
| sitemap.sortByLastmod | Sort URLs by last modified |
| sitemap.count | Count URLs in sitemap |
| sitemap.extractLocs | Extract all loc URLs |
| sitemap.validate | Validate sitemap XML |
Examples
Create sitemap index
sitemap.createIndex [{"loc": "https://example.com/sitemap1.xml"}]Parse XML sitemap
sitemap.parse $xmlParse sitemap index
sitemap.parseIndex $xmlIntegration with RobinPath
import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/sitemap";
const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);
const result = await rp.executeScript(`
sitemap.createIndex [{"loc": "https://example.com/sitemap1.xml"}]
`);Full API Reference
See MODULE.md for complete documentation including all parameters, return types, error handling, and advanced examples.
Related Modules
@robinpath/json— JSON module for complementary functionality
License
MIT
