Sitemap B Framework
Advanced Sitemap Management, Building, Deployment Framework [Open Source]
More info on sitemaps here
Note: Current Release Beta Version - [GA By June,2020]
Installation
npm i sitemap-b-framework --save
https://www.npmjs.com/package/sitemap-b-framework
Features
- Simple and Advanced Sitemap with Index supported
- Auto Deploy Generated Sitemap to S3 or Google Cloud Storage Buckets
- Persistent Local JSON File as Database
- Auto Build and Deploy to Buckets or Local Storage with Manual Trigger and CRON
- Backup Sitemap JSON DB and Sitemap XML to Buckets with Manual Trigger and CRON
- Webpages, Image, Video, News Sitemap Supported
- Sitemap Links with Limit and Locking Constraints In Options
Usage
Simple Usage
var sitemapBFramework = require("sitemap-b-framework");
var SitemapBFramework = new sitemapBFramework();
const data = await SitemapBFramework.sitemapItemAdd('https://example.com/product/laptop');
const data = await SitemapBFramework.sitemapBuildAndDeploy();
Advanced Usage
var sitemapBFramework = require("sitemap-b-framework");
const options = {
path:'data/sitemap',
maxLinksPerSitemap: 50000,
build:{
cron: '0 1 * * *',
deployToBucket: {
s3: {
accessKeyId: "Access Key ID",
secretAccessKey: "Secret Key",
bucket: "Name of Bucket",
path: "Path Inside Bucket",
makePublic: true | false,
},
}
}
}
var SitemapBFramework = new sitemapBFramework(options);
await SitemapBFramework.sitemapIndexAdd('sitemap-products','https://sitemap/sitemap-products.xml','webpages',50000,false);
await SitemapBFramework.sitemapItemAdd('https://example.com/product/laptop','sitemap-products','2020-05-10','monthly',0.5);
await SitemapBFramework.sitemapBuildAndDeploy();
Options Allowed
const options = {
path: 'data/sitemap',
maxLinksPerSitemap: 15000,
build: {
cron: "Cron Expression to auto build sitemap files and deploy to bucket if defined",
deployToBucket: {
gcs: {
projectId: "GCP Project ID",
service_account_key_path: "Path to gcp service account json file",
bucket: "Name of Bucket",
path: "Path Inside Bucket",
makePublic: true | false,
},
s3: {
accessKeyId: "Access Key ID",
secretAccessKey: "Secret Key",
bucket: "Name of Bucket",
path: "Path Inside Bucket",
makePublic: true | false,
},
}
},
backup: {
cron: "Cron Expression to auto backup framework data and sitemap xml files to bucket if defined",
bakcupToBucket: {
gcs: {
projectId: "GCP Project ID",
service_account_key_path: "Path to gcp service account json file",
bucket: "Name of Bucket",
path: "Path Inside Bucket"
},
s3: {
accessKeyId: "Access Key ID",
secretAccessKey: "Secret Key",
bucket: "Name of Bucket",
path: "Path Inside Bucket"
},
}
}
};
Methods Available
sitemapIndexAdd('sitemap-products', 'https://sitemap/sitemap-products.xml', 'webpages', 50000, false);
sitemapIndexUpdate('sitemap-products', 'https://sitemap/sitemap-products-new.xml', 'webpages', 50000, false);
sitemapIndexDelete('sitemap-products');
sitemapIndexList();
sitemapItemAdd('https://example.com/product/laptop', 'sitemap-products', '2020-05-10', 'monthly', 0.5);
sitemapItemUpdate('https://example.com/product/laptop', 'https://example.com/product/laptop-trending', 'sitemap-products', '2020-05-10', 'daily', 0.9);
sitemapItemDelete('https://example.com/product/laptop-trending', 'sitemap-products', );
sitemapItemList('sitemap-products');
sitemapGlobalSearch('https://example.com/product/laptop-trending');
sitemapBuildAndDeploy();
BackupToBucket();
Maintainers
Contributors are welcome
License
See LICENSE file.
Note: Current Release Beta Version - [GA By June,2020]