Skip to content

Commit a965849

Browse files
committed
Parameter config name correction
1 parent 24fd556 commit a965849

File tree

12 files changed

+125
-125
lines changed

12 files changed

+125
-125
lines changed

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ x-crawl is a Nodejs multifunctional crawler library.
4747
* [Method](#Method)
4848
* [RequestConfig](#RequestConfig)
4949
* [IntervalTime](#IntervalTime)
50-
* [XCrawlBaseConifg](#XCrawlBaseConifg)
51-
* [FetchBaseConifgV1](#FetchBaseConifgV1)
52-
* [FetchBaseConifgV2](#FetchBaseConifgV2)
50+
* [XCrawlBaseConfig](#XCrawlBaseConfig)
51+
* [FetchBaseConfigV1](#FetchBaseConfigV1)
52+
* [FetchBaseConfigV2](#FetchBaseConfigV2)
5353
* [FetchHTMLConfig](#FetchHTMLConfig )
5454
* [FetchDataConfig](#FetchDataConfig)
5555
* [FetchFileConfig](#FetchFileConfig)
@@ -101,7 +101,7 @@ Create a crawler instance via call xCrawl. The request queue is maintained by th
101101
For more detailed types, please see the [Types](#Types) section
102102
103103
```ts
104-
function xCrawl(baseConfig?: XCrawlBaseConifg): XCrawlInstance
104+
function xCrawl(baseConfig?: XCrawlBaseConfig): XCrawlInstance
105105
```
106106

107107
#### Example
@@ -185,14 +185,14 @@ function fetchData: <T = any>(
185185
#### Example
186186

187187
```js
188-
const requestConifg = [
188+
const requestConfig = [
189189
{ url: '/xxxx', method: 'GET' },
190190
{ url: '/xxxx', method: 'GET' },
191191
{ url: '/xxxx', method: 'GET' }
192192
]
193193

194194
myXCrawl.fetchData({
195-
requestConifg, // Request configuration, can be RequestConfig | RequestConfig[]
195+
requestConfig, // Request configuration, can be RequestConfig | RequestConfig[]
196196
intervalTime: { max: 5000, min: 1000 } // The intervalTime passed in when not using myXCrawl
197197
}).then(res => {
198198
console.log(res)
@@ -220,14 +220,14 @@ function fetchFile: (
220220
#### Example
221221

222222
```js
223-
const requestConifg = [
223+
const requestConfig = [
224224
{ url: '/xxxx' },
225225
{ url: '/xxxx' },
226226
{ url: '/xxxx' }
227227
]
228228

229229
myXCrawl.fetchFile({
230-
requestConifg,
230+
requestConfig,
231231
fileConfig: {
232232
storeDir: path.resolve(__dirname, './upload') // storage folder
233233
}
@@ -299,10 +299,10 @@ type IntervalTime = number | {
299299
}
300300
```
301301
302-
### XCrawlBaseConifg
302+
### XCrawlBaseConfig
303303
304304
```ts
305-
interface XCrawlBaseConifg {
305+
interface XCrawlBaseConfig {
306306
baseUrl?: string
307307
timeout?: number
308308
intervalTime?: IntervalTime
@@ -311,19 +311,19 @@ interface XCrawlBaseConifg {
311311
}
312312
```
313313
314-
### FetchBaseConifgV1
314+
### FetchBaseConfigV1
315315
316316
```ts
317-
interface FetchBaseConifgV1 {
318-
requestConifg: RequestConfig | RequestConfig[]
317+
interface FetchBaseConfigV1 {
318+
requestConfig: RequestConfig | RequestConfig[]
319319
intervalTime?: IntervalTime
320320
}
321321
```
322322
323-
### FetchBaseConifgV2
323+
### FetchBaseConfigV2
324324
325325
```ts
326-
interface FetchBaseConifgV2 {
326+
interface FetchBaseConfigV2 {
327327
url: string
328328
timeout?: number
329329
proxy?: string
@@ -333,20 +333,20 @@ interface FetchBaseConifgV2 {
333333
### FetchHTMLConfig
334334
335335
```ts
336-
type FetchHTMLConfig = string | FetchBaseConifgV2
336+
type FetchHTMLConfig = string | FetchBaseConfigV2
337337
```
338338
339339
### FetchDataConfig
340340
341341
```ts
342-
interface FetchDataConfig extends FetchBaseConifgV1 {
342+
interface FetchDataConfig extends FetchBaseConfigV1 {
343343
}
344344
```
345345
346346
### FetchFileConfig
347347
348348
```ts
349-
interface FetchFileConfig extends FetchBaseConifgV1 {
349+
interface FetchFileConfig extends FetchBaseConfigV1 {
350350
fileConfig: {
351351
storeDir: string // Store folder
352352
extension?: string // filename extension

docs/cn.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ x-crawl 是 Nodejs 多功能爬虫库。
4747
* [Method](#Method)
4848
* [RequestConfig](#RequestConfig)
4949
* [IntervalTime](#IntervalTime)
50-
* [XCrawlBaseConifg](#XCrawlBaseConifg)
51-
* [FetchBaseConifgV1](#FetchBaseConifgV1)
52-
* [FetchBaseConifgV2](#FetchBaseConifgV2)
50+
* [XCrawlBaseConfig](#XCrawlBaseConfig)
51+
* [FetchBaseConfigV1](#FetchBaseConfigV1)
52+
* [FetchBaseConfigV2](#FetchBaseConfigV2)
5353
* [FetchHTMLConfig](#FetchHTMLConfig )
5454
* [FetchDataConfig](#FetchDataConfig)
5555
* [FetchFileConfig](#FetchFileConfig)
@@ -93,11 +93,11 @@ myXCrawl.startPolling({ d: 1 }, () => {
9393
const imgEls = jsdom.window.document.querySelectorAll('.carousel-wrapper .chief-recom-item img')
9494
9595
// 设置请求配置
96-
const requestConifg = []
97-
imgEls.forEach((item) => requestConifg.push({ url: `https:${item.src}` }))
96+
const requestConfig = []
97+
imgEls.forEach((item) => requestConfig.push({ url: `https:${item.src}` }))
9898
9999
// 调用 fetchFile API 爬取图片
100-
myXCrawl.fetchFile({ requestConifg, fileConfig: { storeDir: './upload' } })
100+
myXCrawl.fetchFile({ requestConfig, fileConfig: { storeDir: './upload' } })
101101
})
102102
})
103103
```
@@ -125,7 +125,7 @@ myXCrawl.startPolling({ d: 1 }, () => {
125125
更详细的类型请看[类型](#类型-6)部分内容
126126
127127
```ts
128-
function xCrawl(baseConfig?: XCrawlBaseConifg): XCrawlInstance
128+
function xCrawl(baseConfig?: XCrawlBaseConfig): XCrawlInstance
129129
```
130130
131131
#### 示例
@@ -209,14 +209,14 @@ function fetchData: <T = any>(
209209
#### 示例
210210
211211
```js
212-
const requestConifg = [
212+
const requestConfig = [
213213
{ url: '/xxxx', method: 'GET' },
214214
{ url: '/xxxx', method: 'GET' },
215215
{ url: '/xxxx', method: 'GET' }
216216
]
217217
218218
myXCrawl.fetchData({
219-
requestConifg, // 请求配置, 可以是 RequestConfig | RequestConfig[]
219+
requestConfig, // 请求配置, 可以是 RequestConfig | RequestConfig[]
220220
intervalTime: { max: 5000, min: 1000 } // 不使用 myXCrawl 时传入的 intervalTime
221221
}).then(res => {
222222
console.log(res)
@@ -244,14 +244,14 @@ function fetchFile: (
244244
#### 示例
245245
246246
```js
247-
const requestConifg = [
247+
const requestConfig = [
248248
{ url: '/xxxx' },
249249
{ url: '/xxxx' },
250250
{ url: '/xxxx' }
251251
]
252252
253253
myXCrawl.fetchFile({
254-
requestConifg,
254+
requestConfig,
255255
fileConfig: {
256256
storeDir: path.resolve(__dirname, './upload') // 存放文件夹
257257
}
@@ -323,10 +323,10 @@ type IntervalTime = number | {
323323
}
324324
```
325325
326-
### XCrawlBaseConifg
326+
### XCrawlBaseConfig
327327
328328
```ts
329-
interface XCrawlBaseConifg {
329+
interface XCrawlBaseConfig {
330330
baseUrl?: string
331331
timeout?: number
332332
intervalTime?: IntervalTime
@@ -335,19 +335,19 @@ interface XCrawlBaseConifg {
335335
}
336336
```
337337
338-
### FetchBaseConifgV1
338+
### FetchBaseConfigV1
339339
340340
```ts
341-
interface FetchBaseConifgV1 {
342-
requestConifg: RequestConfig | RequestConfig[]
341+
interface FetchBaseConfigV1 {
342+
requestConfig: RequestConfig | RequestConfig[]
343343
intervalTime?: IntervalTime
344344
}
345345
```
346346
347-
### FetchBaseConifgV2
347+
### FetchBaseConfigV2
348348
349349
```ts
350-
interface FetchBaseConifgV2 {
350+
interface FetchBaseConfigV2 {
351351
url: string
352352
timeout?: number
353353
proxy?: string
@@ -357,20 +357,20 @@ interface FetchBaseConifgV2 {
357357
### FetchHTMLConfig
358358
359359
```ts
360-
type FetchHTMLConfig = string | FetchBaseConifgV2
360+
type FetchHTMLConfig = string | FetchBaseConfigV2
361361
```
362362
363363
### FetchDataConfig
364364
365365
```ts
366-
interface FetchDataConfig extends FetchBaseConifgV1 {
366+
interface FetchDataConfig extends FetchBaseConfigV1 {
367367
}
368368
```
369369
370370
### FetchFileConfig
371371
372372
```ts
373-
interface FetchFileConfig extends FetchBaseConifgV1 {
373+
interface FetchFileConfig extends FetchBaseConfigV1 {
374374
fileConfig: {
375375
storeDir: string // 存放文件夹
376376
extension?: string // 文件扩展名

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"name": "x-crawl",
4-
"version": "2.1.0",
4+
"version": "2.2.0",
55
"author": "coderHXL",
66
"description": "XCrawl is a Nodejs multifunctional crawler library.",
77
"license": "MIT",

publish/README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ x-crawl is a Nodejs multifunctional crawler library.
4747
* [Method](#Method)
4848
* [RequestConfig](#RequestConfig)
4949
* [IntervalTime](#IntervalTime)
50-
* [XCrawlBaseConifg](#XCrawlBaseConifg)
51-
* [FetchBaseConifgV1](#FetchBaseConifgV1)
52-
* [FetchBaseConifgV2](#FetchBaseConifgV2)
50+
* [XCrawlBaseConfig](#XCrawlBaseConfig)
51+
* [FetchBaseConfigV1](#FetchBaseConfigV1)
52+
* [FetchBaseConfigV2](#FetchBaseConfigV2)
5353
* [FetchHTMLConfig](#FetchHTMLConfig )
5454
* [FetchDataConfig](#FetchDataConfig)
5555
* [FetchFileConfig](#FetchFileConfig)
@@ -101,7 +101,7 @@ Create a crawler instance via call xCrawl. The request queue is maintained by th
101101
For more detailed types, please see the [Types](#Types) section
102102
103103
```ts
104-
function xCrawl(baseConfig?: XCrawlBaseConifg): XCrawlInstance
104+
function xCrawl(baseConfig?: XCrawlBaseConfig): XCrawlInstance
105105
```
106106

107107
#### Example
@@ -185,14 +185,14 @@ function fetchData: <T = any>(
185185
#### Example
186186

187187
```js
188-
const requestConifg = [
188+
const requestConfig = [
189189
{ url: '/xxxx', method: 'GET' },
190190
{ url: '/xxxx', method: 'GET' },
191191
{ url: '/xxxx', method: 'GET' }
192192
]
193193

194194
myXCrawl.fetchData({
195-
requestConifg, // Request configuration, can be RequestConfig | RequestConfig[]
195+
requestConfig, // Request configuration, can be RequestConfig | RequestConfig[]
196196
intervalTime: { max: 5000, min: 1000 } // The intervalTime passed in when not using myXCrawl
197197
}).then(res => {
198198
console.log(res)
@@ -220,14 +220,14 @@ function fetchFile: (
220220
#### Example
221221

222222
```js
223-
const requestConifg = [
223+
const requestConfig = [
224224
{ url: '/xxxx' },
225225
{ url: '/xxxx' },
226226
{ url: '/xxxx' }
227227
]
228228

229229
myXCrawl.fetchFile({
230-
requestConifg,
230+
requestConfig,
231231
fileConfig: {
232232
storeDir: path.resolve(__dirname, './upload') // storage folder
233233
}
@@ -299,10 +299,10 @@ type IntervalTime = number | {
299299
}
300300
```
301301
302-
### XCrawlBaseConifg
302+
### XCrawlBaseConfig
303303
304304
```ts
305-
interface XCrawlBaseConifg {
305+
interface XCrawlBaseConfig {
306306
baseUrl?: string
307307
timeout?: number
308308
intervalTime?: IntervalTime
@@ -311,19 +311,19 @@ interface XCrawlBaseConifg {
311311
}
312312
```
313313
314-
### FetchBaseConifgV1
314+
### FetchBaseConfigV1
315315
316316
```ts
317-
interface FetchBaseConifgV1 {
318-
requestConifg: RequestConfig | RequestConfig[]
317+
interface FetchBaseConfigV1 {
318+
requestConfig: RequestConfig | RequestConfig[]
319319
intervalTime?: IntervalTime
320320
}
321321
```
322322
323-
### FetchBaseConifgV2
323+
### FetchBaseConfigV2
324324
325325
```ts
326-
interface FetchBaseConifgV2 {
326+
interface FetchBaseConfigV2 {
327327
url: string
328328
timeout?: number
329329
proxy?: string
@@ -333,20 +333,20 @@ interface FetchBaseConifgV2 {
333333
### FetchHTMLConfig
334334
335335
```ts
336-
type FetchHTMLConfig = string | FetchBaseConifgV2
336+
type FetchHTMLConfig = string | FetchBaseConfigV2
337337
```
338338
339339
### FetchDataConfig
340340
341341
```ts
342-
interface FetchDataConfig extends FetchBaseConifgV1 {
342+
interface FetchDataConfig extends FetchBaseConfigV1 {
343343
}
344344
```
345345
346346
### FetchFileConfig
347347
348348
```ts
349-
interface FetchFileConfig extends FetchBaseConifgV1 {
349+
interface FetchFileConfig extends FetchBaseConfigV1 {
350350
fileConfig: {
351351
storeDir: string // Store folder
352352
extension?: string // filename extension

publish/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "x-crawl",
3-
"version": "2.1.0",
3+
"version": "2.2.0",
44
"author": "coderHXL",
55
"description": "XCrawl is a Nodejs multifunctional crawler library.",
66
"license": "MIT",

0 commit comments

Comments
 (0)