This is a sitemap utility that extracts sitemap url and all the urls from the sitemap.
note: This is not a sitemap generator or web crawler.
npm install nekomap
pnpm add nekomap
yarn add nekomap
import NekoMap from 'nekomap';
const websiteUrl = 'https://example.com'; // https://example.com/sitemap.xml or any url
const nekoMap = new NekoMap(websiteUrl);
nekoMap.getSiteMapUrls().then(sitemapUrls => {
console.log(sitemapUrls); // string | null if no sitemap url found
});
nekoMap.getUrls().then(urls => {
console.log(urls); // string[] | null if no urls found
});
This is a personal project and not affiliated with any organization. Use at your own risk.