Sitemap B Framework
Advanced Sitemap Management, Building, Deployment Framework [Open Source]
More info on sitemaps here
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');
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.xml','webpages',50000,false);
await SitemapBFramework.sitemapItemAdd('https://example.com/product/laptop','sitemap-products.xml','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.xml','webpages',50000,false);
sitemapIndexUpdate('sitemap-products.xml','sitemap-products-trending.xml','webpages',50000,false);
sitemapIndexDelete('sitemap-products-trending.xml');
sitemapIndexList();
sitemapItemAdd('https://example.com/product/laptop','sitemap-products.xml','2020-05-10','monthly',0.5);
sitemapItemUpdate('https://example.com/product/laptop','https://example.com/product/laptop-trending','sitemap-products.xml','2020-05-10','daily',0.9);
sitemapItemDelete('https://example.com/product/laptop-trending','sitemap-products.xml');
sitemapItemList('sitemap-products.xml');
sitemapGlobalSearch('ttps://example.com/product/laptop-trending');
sitemapBuildAndDeploy();
BackupToBucket();
Maintainers
Contributors are welcome
License
See LICENSE file.
Development In Progress [GA by june,2020]