{"size": 476, "ext": "js", "max_stars_repo_path": "examples/sitemap.js", "max_stars_repo_name": "ppwfx/hookstate", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "examples/sitemap.js", "max_issues_repo_name": "ppwfx/hookstate", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "examples/sitemap.js", "max_forks_repo_name": "ppwfx/hookstate", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 26.4444444444, "max_line_length": 76, "alphanum_fraction": 0.6659663866}
const { createSitemap } = require('sitemap');
const ExampleIds = require('./src/examples/ids');
const fs = require('fs')

const baseUrl = 'https://hookstate.netlify.com'

const exampleUrls = Object.values(ExampleIds).map(id => `${baseUrl}/${id}`);

const sitemap = createSitemap({
    hostname: baseUrl,
    cacheTime: 3600000,        // 1 hour
    urls: exampleUrls.map(u => ({ url: u }))
});

const xml = sitemap.toXML(true)

fs.writeFileSync('build/sitemap.xml', sitemap);
