indexnow-sitemap-cron
v1.0.0
Published
Periodically pings sitemap URLs to IndexNow API using cron.
Downloads
75
Maintainers
Readme
IndexNow Sitemap Cron
A lightweight Node.js module that periodically sends URLs from your sitemap to the IndexNow API.
Perfect for SEO automation on frequently updated websites.
📦 Installation
npm i indexnow-sitemap-cron🚀 Usage
const indexnowCron = require('indexnow-sitemap-cron');
indexnowCron({
sitemapUrl: 'https://example.com/sitemap.xml',
host: 'example.com',
key: 'YOUR_INDEXNOW_KEY',
keyLocation: 'https://example.com/YOUR_INDEXNOW_KEY.txt',
cronTime: '0 5 * * *', // Optional, defaults to daily at 5:00 AM
});⚙️ Options
| Option | Type | Required | Description |
|---------------|----------|----------|-----------------------------------------------------------|
| sitemapUrl | string | ✅ | Full URL to your sitemap.xml |
| host | string | ✅ | Your domain (e.g. example.com) |
| key | string | ✅ | IndexNow key |
| keyLocation | string | ✅ | Public key location (URL to your .txt verification key)|
| cronTime | string | ❌ | Cron syntax (e.g. 0 */6 * * * to run every 6 hours) |
| logger | object | ❌ | Optional logger, defaults to console |
🧪 Test Run
To trigger the cron and run immediately:
node yourApp.js📄 License
MIT
