Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
simple-sitemap-renderer
Advanced tools
A bare minimum sitemap renderer written in TypeScript.
$ npm i simple-sitemap-renderer
or
yarn add simple-sitemap-renderer
import { renderSitemap } from 'simple-sitemap-renderer'
renderSitemap([
{
url: 'https://your-site/your-page-1',
lastmod: '2020-10-10',
changefreq: 'always',
priority: 0.8,
},
{
url: 'https://your-site/your-page-2',
lastmod: '2020-10-10',
},
{
url: 'https://your-site/your-page-3',
},
])
the sample here is formatted for readability, but actual result will always be minified.
<?xml version="1.0" encoding="UTF-8"?>
<urlset>
<url>
<loc>https://your-site/your-page-1</loc>
<lastmod>2020-10-10</lastmod>
<changefreq>always</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://your-site/your-page-2</loc>
<lastmod>2020-10-10</lastmod>
</url>
<url>
<loc>https://your-site/your-page-3</loc>
</url>
</urlset>
returns sitemap xml string.
type Entry = {
url: string
lastmod?: string // yyyy-mm-dd
changefreq?: ChangeFreq // always|hourly|daily|weekly|monthly|yearly|never
priority?: number // 0.0 ~ 1.0
}
type RenderOptiopns = {
encodeUrl?: boolean
}
encodeUrl
: If you want this libary to encode urls for you, set it to true. (Otherwise, you don't need this option.)FAQs
A bare minimum sitemap renderer
The npm package simple-sitemap-renderer receives a total of 151 weekly downloads. As such, simple-sitemap-renderer popularity was classified as not popular.
We found that simple-sitemap-renderer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.