Skip to content

Commit 5c6209d

Browse files
authored
Update README.md
1 parent 40ecefa commit 5c6209d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,18 @@ Positive number, maximum allowed depth for hyperlinks. Other dependencies will b
109109

110110
#### maxDepth
111111
Positive number, maximum allowed depth for all dependencies. Defaults to `null` - no maximum depth set.
112+
In most of cases you need [maxRecursiveDepth](#maxRecursiveDepth) instead of this option.
113+
114+
The difference between [maxRecursiveDepth](#maxRecursiveDepth) and [maxDepth](#maxDepth) is that
115+
* maxDepth is for all type of resources, so if you have
116+
> maxDepth=1 AND html (depth 0) ⟶ html (depth 1) ⟶ img (depth 2)
117+
118+
last image will be filtered out by depth
119+
120+
* maxRecursiveDepth is only for html resources, so if you have
121+
> maxRecursiveDepth=1 AND html (depth 0) ⟶ html (depth 1) ⟶ img (depth 2)
122+
123+
only html resources with depth 2 will be filtered out, last image will be downloaded
112124

113125
#### request
114126
Object, custom options for [request](https://github.com/request/request#requestoptions-callback). Allows to set cookies, userAgent, encoding, etc.

0 commit comments

Comments
 (0)