Comparing version 0.3.1 to 0.4.0
@@ -505,3 +505,3 @@ 'use strict'; | ||
requestRes.forEach(function (requestResItem) { | ||
var _headers$contentType; | ||
var _headers$contentType, _fileConfig$extension; | ||
var id = requestResItem.id, | ||
@@ -511,5 +511,5 @@ headers = requestResItem.headers, | ||
var mimeType = (_headers$contentType = headers['content-type']) !== null && _headers$contentType !== void 0 ? _headers$contentType : ''; | ||
var suffix = mimeType.split('/').pop(); | ||
var fileExtension = (_fileConfig$extension = fileConfig.extension) !== null && _fileConfig$extension !== void 0 ? _fileConfig$extension : mimeType.split('/').pop(); | ||
var fileName = new Date().getTime().toString(); | ||
var filePath = path.resolve(fileConfig.storeDir, "".concat(fileName, ".").concat(suffix)); | ||
var filePath = path.resolve(fileConfig.storeDir, "".concat(fileName, ".").concat(fileExtension)); | ||
try { | ||
@@ -516,0 +516,0 @@ fs.writeFileSync(filePath, data); |
{ | ||
"name": "x-crawl", | ||
"version": "0.3.1", | ||
"version": "0.4.0", | ||
"author": "CoderHxl", | ||
@@ -5,0 +5,0 @@ "description": "XCrawl is a Nodejs multifunctional crawler library.", |
@@ -20,3 +20,3 @@ # x-crawl | ||
- [Example](#Example) | ||
- [Core concepts](#Core concepts) | ||
- [Core concepts](#Core-concepts) | ||
* [XCrawl](#XCrawl) | ||
@@ -314,3 +314,4 @@ + [Type](#Type-1) | ||
fileConfig: { | ||
storeDir: string | ||
storeDir: string // store folder | ||
extension?: string // filename extension | ||
} | ||
@@ -317,0 +318,0 @@ } |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
89435
369