File tree Expand file tree Collapse file tree 3 files changed +6
-7
lines changed Expand file tree Collapse file tree 3 files changed +6
-7
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"private" : true ,
3
- "name" : " x-crawler " ,
3
+ "name" : " x-crawl " ,
4
4
"version" : " 0.0.1" ,
5
5
"author" : " coderhxl" ,
6
6
"description" : " XCrawl is a Nodejs crawl library, providing configurations to help you crawl data or files in batches." ,
Original file line number Diff line number Diff line change 1
1
{
2
- "name" : " x-crawler " ,
2
+ "name" : " x-crawl " ,
3
3
"version" : " 0.0.1" ,
4
4
"author" : " coderhxl" ,
5
5
"description" : " XCrawl is a Nodejs crawl library, providing configurations to help you crawl data or files in batches." ,
6
6
"license" : " MIT" ,
7
7
"main" : " dist/index.js" ,
8
8
"types" : " " ,
9
- "homepage" : " https://github.com/coder-hxl/crawler /tree/main/publish" ,
9
+ "homepage" : " https://github.com/coder-hxl/x-crawl /tree/main/publish" ,
10
10
"repository" : {
11
11
"type" : " git" ,
12
- "url" : " https://github.com/coder-hxl/crawler "
12
+ "url" : " https://github.com/coder-hxl/x-crawl "
13
13
},
14
14
"scripts" : {},
15
15
"exports" : {
Original file line number Diff line number Diff line change @@ -46,9 +46,8 @@ export default class XCrawl {
46
46
function eachRequestResHandle ( requestRes : IRequest , currentCount : number ) {
47
47
const { headers, data } = requestRes
48
48
49
- const filename = `${ new Date ( ) . getTime ( ) } .${ headers [ 'content-type' ]
50
- ?. split ( '/' )
51
- . pop ( ) } `
49
+ const fileType = headers [ 'content-type' ] ?. split ( '/' ) . pop ( )
50
+ const filename = `${ new Date ( ) . getTime ( ) } .${ fileType } `
52
51
const path = `${ fileConfig . storeDir } /${ filename } `
53
52
54
53
fs . createWriteStream ( path , 'binary' ) . write ( data , ( err ) => {
You can’t perform that action at this time.
0 commit comments