Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@montacasa/sitemap-generator
Advanced tools
Readme
Generates a sitemap.xml from a given list of links.
It can also generate multiple sitemaps and a sitemap index file, if the number of links exceeds the maximum per sitemap.
npm i @montacasa/sitemap-generator
. const generator = require('@montacasa/sitemap-generator');
// Define the sitemap urls
const urls = [
"https://www.example.com/path/1",
"https://www.example.com/path/2",
"https://www.example.com/path/3"
];
// ..and some other options
const filepath = './src/sitemap.xml';
const domain = 'https://www.example.com';
// Create an async function
const sitemap = async() => {
const message = await generator({domain, filepath, urls});
console.info(message);
}
// Generate!
sitemap(); // 'DONE! One single sitemap generated with 3 links.'
An array of links. Optional.
E.g.:
[
"https://www.example.com/path/1",
"https://www.example.com/path/2",
"https://www.example.com/path/3",
// ...
]
A file path for a list of links. Optional.
E.g.: ./urls
containing:
"https://www.example.com/path/1"
"https://www.example.com/path/2"
"https://www.example.com/path/3"
...
The maximum number of links per sitemap. Optional, default is 50.000 according to sitemaps.org FAQ.
The path to which the generator should write the sitemap(s). Optional,
default is ./sitemap.xml
.
Optional. If not provided, the domain is extracted from the first link in the links list (either the file or array).
The domain
is to be used in the sitemap index file. E.g.:
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://www.example.br/sitemap-0.xml</loc>
</sitemap>
<sitemap>
<loc>https://www.example.br/sitemap-1.xml</loc>
</sitemap>
<sitemap>
<loc>https://www.example.br/sitemap-2.xml</loc>
</sitemap>
</sitemapindex>
urls
and file
are optional, but you must provide either one or another!If both urls
and file
are provided, file
will prevail over urls
.
If the number of links in urls
or file
is higher then max
, the sitemap will be split in
as many sitemaps as needed at the same dir, and a sitemap index will be created at
filepath
.
In that case, supposing you are using default values, sitemap.xml would be the sitemap index and the sitemaps would be named sitemap-0.xml, sitemap-1.xml and so on, with maximum 50k links each. (See example above.)
FAQs
Montacasa's frontend sitemap generator
The npm package @montacasa/sitemap-generator receives a total of 23 weekly downloads. As such, @montacasa/sitemap-generator popularity was classified as not popular.
We found that @montacasa/sitemap-generator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.