{"_id":"@crisp-fix/express-sitemap","_rev":"2-3dda1fda731605f6857c2e126d1248e9","name":"@crisp-fix/express-sitemap","dist-tags":{"latest":"1.8.0"},"versions":{"1.8.0":{"name":"@crisp-fix/express-sitemap","version":"1.8.0","keywords":["sitemap","robots","routing","express"],"author":{"url":"https://hex7c0.github.io/","name":"hex7c0","email":"hex7c0@gmail.com"},"license":"GPL-3.0","_id":"@crisp-fix/express-sitemap@1.8.0","maintainers":[{"name":"crisp-dev","email":"dev@crisp.chat"},{"name":"valerian.saliou","email":"valerian@valeriansaliou.name"}],"homepage":"https://github.com/hex7c0/express-sitemap","bugs":{"url":"https://github.com/hex7c0/express-sitemap/issues","email":"hex7c0@gmail.com"},"dist":{"shasum":"fb01f0707b075a0b15a8d1831227ab8fb91e408f","tarball":"https://registry.npmjs.org/@crisp-fix/express-sitemap/-/express-sitemap-1.8.0.tgz","fileCount":6,"integrity":"sha512-QC8tQ1BkhIymMBhPlThS34WstHGxxpBbCNLMfCuPTXMdTRxZaKXUJb1TUhqjXF3q8oIdhNt4J9jMBrO9dMp6IA==","signatures":[{"sig":"MEYCIQC8uAI/0wZ4isE7iuMCdacvcmScAC0W99POTb1+DDvWeAIhALynAZJ8CRoV0ksjb93cUu2GemosZ0xMvzgJLPJnfDpa","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":63928},"main":"index.min.js","engines":{"node":">=4"},"gitHead":"49e89a7df9601828cb7c5139434082e7cd4d821f","scripts":{"test":"npm run express4 && npm install express@3 && npm run express3","_prepare":"npm prune","express3":"mocha --bail --check-leaks","express4":"mocha test/*","test-cov":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- test/*","prepublishOnly":"grunt"},"_npmUser":{"name":"valerian.saliou","email":"valerian@valeriansaliou.name"},"repository":{"url":"git+https://github.com/hex7c0/express-sitemap.git","type":"git"},"_npmVersion":"11.6.2","description":"sitemap and robots for expressjs","directories":{},"_nodeVersion":"24.11.0","dependencies":{"tickle":"1.5.0","request":"^2.81.0","setheaders":"0.4.0","body-parser":"^1.17.2"},"preferGlobal":false,"_hasShrinkwrap":false,"devDependencies":{"grunt":"~1.0","mocha":"~4.1","express":"~4.16","istanbul":"~0.4","supertest":"~3.0","grunt-endline":"~0.7","grunt-safer-regex":"~0.1","grunt-contrib-jshint":"~1.1","grunt-contrib-uglify":"~3.3"},"_npmOperationalInternal":{"tmp":"tmp/express-sitemap_1.8.0_1765725924515_0.2070398802846094","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-12-14T15:25:24.438Z","modified":"2025-12-15T10:03:22.482Z","1.8.0":"2025-12-14T15:25:24.682Z"},"bugs":{"url":"https://github.com/hex7c0/express-sitemap/issues","email":"hex7c0@gmail.com"},"author":{"url":"https://hex7c0.github.io/","name":"hex7c0","email":"hex7c0@gmail.com"},"license":"GPL-3.0","homepage":"https://github.com/hex7c0/express-sitemap","keywords":["sitemap","robots","routing","express"],"repository":{"url":"git+https://github.com/hex7c0/express-sitemap.git","type":"git"},"description":"sitemap and robots for expressjs","maintainers":[{"email":"dev@crisp.chat","name":"crisp-dev"},{"email":"valerian@valeriansaliou.name","name":"valerian.saliou"},{"email":"dev@eliottvincent.com","name":"eliottvct"},{"email":"baptistejamin@gmail.com","name":"baptistejamin"}],"readme":"# [express-sitemap](https://github.com/hex7c0/express-sitemap)\n\n[![NPM version](https://img.shields.io/npm/v/express-sitemap.svg)](https://www.npmjs.com/package/express-sitemap)\n[![Linux Status](https://img.shields.io/travis/hex7c0/express-sitemap.svg?label=linux-osx)](https://travis-ci.org/hex7c0/express-sitemap)\n[![Windows Status](https://img.shields.io/appveyor/ci/hex7c0/express-sitemap.svg?label=windows)](https://ci.appveyor.com/project/hex7c0/express-sitemap)\n[![Dependency Status](https://img.shields.io/david/hex7c0/express-sitemap.svg)](https://david-dm.org/hex7c0/express-sitemap)\n[![Coveralls](https://img.shields.io/coveralls/hex7c0/express-sitemap.svg)](https://coveralls.io/r/hex7c0/express-sitemap)\n\nSitemap and Robots for [expressjs](http://expressjs.com/) 3 and 4\n\n## Installation\n\nInstall through NPM\n\n```bash\nnpm install express-sitemap\n```\nor\n```bash\ngit clone git://github.com/hex7c0/express-sitemap.git\n```\n\n## API\n\ninside expressjs project\n```js\nvar sitemap = require('express-sitemap')();\n\nvar app = require('express')();\n\nsitemap.generate(app);\n```\n\n### Methods\n\nif you want generate your own url\n```js\nvar sitemap = require('express-sitemap');\n\nsitemap({\n    map: {\n        '/foo': ['get'],\n        '/foo2': ['get','post'],\n        '/admin': ['get'],\n        '/backdoor': [],\n    },\n    route: {\n        '/foo': {\n            lastmod: '2014-06-20',\n            changefreq: 'always',\n            priority: 1.0,\n        },\n        '/admin': {\n            disallow: true,\n        },\n        '/backdoor': {\n            hide: true,\n        },\n    },\n}).XMLtoFile();\n```\n\nand this will be sitemap.xml\n```xml\n<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n    <url>\n        <loc>http://127.0.0.1/foo</loc>\n        <lastmod>2014-06-19</lastmod>\n        <changefreq>always</changefreq>\n        <priority>1</priority>\n    </url>\n    <url>\n        <loc>http://127.0.0.1/foo2</loc>\n    </url>\n</urlset>\n```\n\nand this will be robots.txt\n```txt\nUser-agent: *\nDisallow: /admin\n```\n\nreset prototype Object for sitemap\n```js\nsitemap.reset();\n```\n\ngenerate sitemap (wrapper)\n```js\nsitemap.generate(app);\n```\n\ngenerate sitemap from express 4.x configuration. Add an array with Router path if you want use nested callback\n```js\nsitemap.generate4(app [, Router]);\n```\n\ngenerate sitemap from express 3.x configuration\n```js\nsitemap.generate3(app);\n```\n\ngenerate prototype Object for sitemap if you use middleware or dynamic building\n```js\nsitemap.tickle();\n```\n\nwrite sitemap Object to file (set pathname inside module configuration or like argument)\n```js\nsitemap.XMLtoFile([path]);\n```\n\nwrite robots.txt to file (set pathname inside module configuration or like argument)\n```js\nsitemap.TXTtoFile([path]);\n```\n\nwrite both to files\n```js\nsitemap.toFile();\n```\n\nstream sitemap to web\n```js\nsitemap.XMLtoWeb(res);\n```\n\nstream robots.txt to web\n```js\nsitemap.TXTtoWeb(res);\n```\n\n### sitemap(options)\n\n#### options\n\n - `http` - **String** Website HTTP protocol (http | https) *(default \"http\")*\n - `cache` - **Integer** Enable cache integration, refresh map after this millisecond value *(default \"false\")*\n - `url` - **String** Website URL *(default \"127.0.0.1\")*\n - `port` - **Number** Website Port *(default \"80\")*\n - `head` - **String** Head of XML file *(default \"<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\")*\n - `sitemap` - **String** Name of sitemap file *(default \"sitemap.xml\")*\n - `robots` - **String** Name of robots file *(default \"robots.txt\")*\n - `sitemapSubmission` - **String** Set `Sitemap` absolute location into robots *(default \"disable\")*\n - `route` - **Object** Add extra information to sitemap related to this [documentation](http://www.sitemaps.org/protocol.html#xmlTagDefinitions) *(default \"disabled\")*\n  - `lastmod` - **Date** Integrity not controlled\n  - `changefreq` - **String** Integrity not controlled\n  - `priority` - **Float** Integrity not controlled\n  - `alternatepages` - **Array** Add alternate language pages related to this [documentation](https://support.google.com/webmasters/answer/2620865)\n    - `rel` - **String** Integrity not controlled\n    - `hreflang` - **String** Integrity not controlled\n    - `href` - **String** Integrity not controlled\n  - `allow` - **Boolean** Flag for \"allow\" this route from parsing, and save into `robots.txt` *(default \"null\")*\n  - `disallow` - **Boolean** Flag for \"disallow\" this route from parsing, and save into `robots.txt` *(default \"null\")*\n  - `hide` - **Boolean** Flag for hide this route from globally parsing (no .xml or .txt) *(default \"false\")*\n - `map` - **Object** Force route (<loc>) detection and building *(default \"disabled\")*\n - `hideByRegex` - **Array** Array of RegEx that remove routes from output *(default \"disabled\")*\n - `generate` - **Object** Fastly generate sitemap from express app *(default \"disabled\")*\n\nyou can use `route: {'ALL': {} }` if you want propagate extra information to all your urls\n\n## Examples\n\nTake a look at my [examples](examples)\n\n### [License GPLv3](LICENSE)\n","readmeFilename":"README.md"}