Nonflavored Prescription Medicine
Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

submit-sitemap

0.1.3 • Public • Published

submit-sitemap module for Node.js

Travis CI build status Version badge

Module to submit/ping a sitemap XML file to Google and Bing. This automates the manual process of submitting your sitemap via Google's webmaster tools and Bing's webmaster tools.

Use this after your site content has changed to encourage search engines to recrawl your site for Search Engine Optimisation (SEO) purposes. For example, this is useful to do after deploying a site update in Grunt and Gulp scripts.

If you're looking for modules to generate sitemaps, you may want to consider grunt-sitemap for Grunt and gulp-sitemap for Gulp.

Usage

To install:

npm install submit-sitemap --save-dev

To submit your sitemap:

var submitSitemap  = require('submit-sitemap').submitSitemap;
var yourSitemapUrl = "http://www.google.com/sitemap.xml";

submitSitemap(yourSitemapUrl);

Use the callback parameter to respond to success and failure:

submitSitemap(yourSitemapUrl,  function(err) { console.error(err); });
  • On success, err will be undefined.

  • On error, err will be set to an error message. This happens if the sitemap URL could not be reached or any of the sitemap submission attempts failed.

Tests

To run the test suite:

npm test

License

MIT

Author

Written by Sean Wilson (sw@seanw.org).

install

npm i submit-sitemap

Downloadsweekly downloads

97

version

0.1.3

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability