Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
simple-sitemap
Advanced tools
A simple sitemap module that supports sites larger than 50,000 pages and automatically submits to Bing and Google.
This is a simple sitemap module that allows an easy way of adding pages to a sitemap, with per-page configuration. Additionally, the package features a couple additional goodies not found in other sitemap packages: it automatically handles multiple sitemaps for sites over 50,000 pages, and automatically submits sitemaps to both Google and Bing.
npm install simple-sitemap
The constructor takes two arguments, your site's root domain, and an optional distribution path. If you don't specify a distribution path, the script will write the sitemap(s) to root by default.
var Sitemap = require('simple-sitemap');
// Set up the Sitemap module
var sitemap = new Sitemap("www.yourdomain.com", "/dist");
// Add a page to the sitemap
sitemap.add("http://www.yourdomain.com/page.html");
// Flush the sitemap to disk and submit to Bing and Google
sitemap.flush(function(){
//whatever you do next
});
The module has the following methods:
.add(url, changeFrequency, priority
- Adds a URL to the sitemap, optionally setting the change frequency and priority for the page. Arguments for the method are:
url
(String | required) - the absolute URL for the page you're adding.changeFrequency
(String | optional, default: "Daily"
) - change frequency for the page. Check sitemaps.org for valid values.priority
(Float | optional, default: 0.5
) - a number between 0 and 1.0 indicating the priority of this URL. Check sitemaps.org for more details on this number..flush(callback)
- writes the sitemap to disk and submits to Google and Bing. Generally, you'll want to call this once you're finished adding URLs to the sitemap. This method is used internally to automagically handle writing sitemaps to disk in the case of sites with more thatn 50,000 pages.
Takes a callback that will run when it's finished submitting to Google and Bing.
Sitemaps are named with a count appended to the end of the filename by default. For example, most small sites will end up with a sitemap called sitemap-01.xml
. This appended value will increase based on the number of sitemaps automatically created.
FAQs
A simple sitemap module that supports sites larger than 50,000 pages and automatically submits to Bing and Google.
The npm package simple-sitemap receives a total of 1 weekly downloads. As such, simple-sitemap popularity was classified as not popular.
We found that simple-sitemap 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.