Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
sitemap-creator
Advanced tools
A sitemap generator based on glob patterns. The lastmod
tag can also be set to pull from the last modified time of a different file.
$ npm install --save sitemap-creator
const sitemap = require('sitemap-creator')
sitemap({
url: 'http://www.example.com/',
content: {
'/': {
priority: 1,
lastmod: '2015-06-27T15:30:00.000Z'
},
'/page/*': {
priority: 0.7,
changefreq: 'monthly'
}
},
outputFile: './sitemap.xml'
})
.then(console.log)
.catch(console.error)
A function or a string can be supplied as the lastMod
.
sitemap({
url: 'http://www.example.com/',
content: {
'/content/**/*': {
lastMod: '2017-02-22T21:31:44.000Z'
},
'/page/*': {
fileTimestamp: function(path, cb){
const json = require('./data.json')
cb(json.lastModified)
}
}
},
})
.then(console.log)
.catch(console.error)
A function or a string can be supplied as the fileTimestamp
. This will get the last modified date from the file to use as the lastmod
for the pages that match the glob path.
sitemap({
url: 'http://www.example.com/',
content: {
'/content/**/*': {
fileTimestamp: './src/content.json'
},
'/page/*': {
fileTimestamp: function(path, cb){
path = path.replace('/page/', '')
cb('./views/' + path + '.pug')
}
}
},
})
.then(console.log)
.catch(console.error)
sitemap({
url: 'http://www.example.com/',
exclude: [
'/admin/**/*',
'/login'
],
})
.then(console.log)
.catch(console.error)
url
: [String] The root domain to be crawledreplaceUrl
: [String] Replaces the url in the final sitemapcontent
: [Object] Paths to supply tags for glob patternsexclude
: [Array] An array of glob patterns to be excludedoutputFile
: [String] Saves out the sitemap file to path specifiedlog
: [Function] Pass a function to handle logsdepth
: [Number] Set to limit the number of pages crawledpretty
: [Boolean/String] Set to prettify XML contentFAQs
Crawls a site and creates sitemaps based on glob patterns
The npm package sitemap-creator receives a total of 5 weekly downloads. As such, sitemap-creator popularity was classified as not popular.
We found that sitemap-creator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.