New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

sitemap-generator-cli

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sitemap-generator-cli - npm Package Compare versions

Comparing version 4.1.0 to 4.2.0

.editorconfig

63

package.json
{
"name": "sitemap-generator-cli",
"version": "4.1.0",
"version": "4.2.0",
"description": "Create xml sitemaps from the command line.",

@@ -21,3 +21,3 @@ "homepage": "https://github.com/lgraubner/sitemap-generator-cli",

],
"main": "cli.js",
"main": "index.js",
"repository": {

@@ -31,22 +31,59 @@ "type": "git",

"dependencies": {
"chalk": "^1.1.3",
"commander": "^2.9.0",
"sitemap-generator": "^4.1.1"
"chalk": "2.4.1",
"commander": "2.19.0",
"sitemap-generator": "^8.3.2"
},
"devDependencies": {
"eslint": "5.9.0",
"execa": "1.0.0",
"husky": "1.2.0",
"jest": "23.6.0",
"lint-staged": "8.1.0",
"prettier": "1.15.3"
},
"preferGlobal": true,
"engines": {
"node": ">=0.12"
"node": ">=6"
},
"bin": {
"sitemap-generator": "cli.js"
"sitemap-generator": "index.js"
},
"license": "MIT",
"devDependencies": {
"ava": "^0.15.2",
"eslint": "^3.0.0",
"eslint-config-graubnla": "^3.0.0"
"scripts": {
"lint": "eslint .",
"test": "jest"
},
"scripts": {
"test": "eslint cli.js && NODE_ENV=development ava test/cli.js"
"lint-staged": {
"*.js": [
"eslint --fix",
"prettier --write",
"git add"
]
},
"prettier": {
"singleQuote": true
},
"eslintConfig": {
"parserOptions": {
"ecmaVersion": 6
},
"extends": [
"eslint:recommended"
],
"env": {
"jest": true,
"node": true
},
"rules": {
"no-console": 0
}
},
"jest": {
"testEnvironment": "node"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
}
}

@@ -1,71 +0,104 @@

# Node Sitemap Generator
# Sitemap Generator CLI
[![Travis](https://img.shields.io/travis/lgraubner/sitemap-generator-cli.svg)](https://travis-ci.org/lgraubner/sitemap-generator-cli) [![David](https://img.shields.io/david/lgraubner/sitemap-generator-cli.svg)](https://david-dm.org/lgraubner/sitemap-generator-cli) [![David Dev](https://img.shields.io/david/dev/lgraubner/sitemap-generator-cli.svg)](https://david-dm.org/lgraubner/sitemap-generator-cli#info=devDependencies) [![npm](https://img.shields.io/npm/v/sitemap-generator-cli.svg)](https://www.npmjs.com/package/sitemap-generator-cli)
[![Travis](https://img.shields.io/travis/lgraubner/sitemap-generator-cli.svg)](https://travis-ci.org/lgraubner/sitemap-generator-cli) [![David](https://img.shields.io/david/lgraubner/sitemap-generator-cli.svg)](https://david-dm.org/lgraubner/sitemap-generator-cli) [![npm](https://img.shields.io/npm/v/sitemap-generator-cli.svg)](https://www.npmjs.com/package/sitemap-generator-cli)
> Create xml sitemaps from the command line.
## Installation
Generates a sitemap by crawling your site. Uses streams to efficiently write the sitemap to your drive. Is cappable of creating multiple sitemaps if threshold is reached. Respects robots.txt and meta tags.
## Table of contents
- [Install](#install)
- [Usage](#usage)
- [Options](#options)
- [License](#license)
## Install
This module is available on [npm](https://www.npmjs.com/).
```BASH
$ npm install -g sitemap-generator-cli
npm install -g sitemap-generator-cli
# or execute it directly with npx (since npm v5.2)
npx sitemap-generator-cli https://example.com
```
## Usage
```BASH
$ sitemap-generator [options] <url>
```
The crawler will fetch all folder URL pages and file types [parsed by Google](https://support.google.com/webmasters/answer/35287?hl=en). If present the `robots.txt` will be taken into account and possible rules are applied for each URL to consider if it should be added to the sitemap. Also the crawler will not fetch URL's from a page if the robots meta tag with the value `nofollow` is present and ignore them completely if `noindex` rule is present. The crawler is able to apply the `base` value to found links.
When the crawler finished the XML Sitemap will be built and printed directly to your console. Pass the sitemap to save the sitemap as a file or do something else:
```BASH
$ sitemap-generator http://example.com > sitemap.xml
sitemap-generator [options] <url>
```
To save it in a subfolder simply provide a relativ path. You can pick any filename you want.
When the crawler finished the XML Sitemap will be built and saved to your specified filepath. If the count of fetched pages is greater than 50000 it will be splitted into several sitemap files and create a sitemapindex file. Google does not allow more than 50000 items in one sitemap.
Example:
```BASH
$ sitemap-generator http://example.com > ./subfolder/mysitemap.xml
sitemap-generator http://example.com
```
## Options
```BASH
$ sitemap-generator --help
sitemap-generator --help
Usage: sitemap-generator [options] <url>
Usage: cli [options] <url>
Options:
-h, --help output usage information
-V, --version output the version number
-b, --baseurl only allow URLs which match given <url>
-d, --dry show status messages without generating a sitemap
-q, --query consider query string
-V, --version output the version number
-f, --filepath <filepath> path to file including filename (default: sitemap.xml)
-m, --max-entries <maxEntries> limits the maximum number of URLs per sitemap file (default: 50000)
-d, --max-depth <maxDepth> limits the maximum distance from the original request (default: 0)
-q, --query consider query string
-u, --user-agent <agent> set custom User Agent
-v, --verbose print details when crawling
-c, --max-concurrency <maxConcurrency> maximum number of requests the crawler will run simultaneously (default: 5)
-r, --no-respect-robots-txt controls whether the crawler should respect rules in robots.txt
-h, --help output usage information
```
Example:
### filepath
```Bash
// strictly match given path and consider query string
$ sitemap-generator -bq example.com/foo/
```
Path to file to write including the filename itself. Path can be absolute or relative. Default is `sitemap.xml`.
### `--baseurl`
Examples:
Default: `false`
- `sitemap.xml`
- `mymap.xml`
- `/var/www/sitemap.xml`
- `./sitemap.myext`
If you specify an URL with a path (e.g. `http://example.com/foo/`) and this option is set to `true` the crawler will only fetch URL's matching `example.com/foo/*`. Otherwise it could also fetch `example.com` in case a link to this URL is provided
### maxConcurrency
### `--dry`
Sets the maximum number of requests the crawler will run simultaneously (default: 5).
Default: `false`
### maxEntries
Use this option to make a dry run and check the generation process to see which sites are fetched and if there are any errors.
Will not create a sitemap!
fine a limit of URLs per sitemap files, useful for site with lots of urls. Defaults to 50000.
### `--query`
### maxDepth
Default: `false`
Set a maximum distance from the original request to crawl URLs, useful for generating smaller `sitemap.xml` files. Defaults to 0, which means it will crawl all levels.
### noRespectRobotsTxt
Controls whether the crawler should respect rules in robots.txt.
### query
Consider URLs with query strings like `http://www.example.com/?foo=bar` as indiviual sites and add them to the sitemap.
### user-agent
Set a custom User Agent used for crawling. Default is `Node/SitemapGenerator`.
### verbose
Print debug messages during crawling process. Also prints out a summery when finished.
## License
[MIT](https://github.com/lgraubner/sitemap-generator/blob/master/LICENSE) © [Lars Graubner](https://larsgraubner.com)

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc