stockshark-drive-local
Advanced tools
Comparing version 1.0.12 to 1.0.13
{ | ||
"name": "stockshark-drive-local", | ||
"version": "1.0.12", | ||
"version": "1.0.13", | ||
"description": "Local Drive for StockShark", | ||
@@ -5,0 +5,0 @@ "main": "./src/index.js", |
@@ -35,29 +35,28 @@ const path = require('path') | ||
async loadTextFileLastLine(fileName) { | ||
this.checkRootFolder() | ||
const filePath = path.resolve(this.currentFolderPath, fileName) | ||
if (!fs.pathExistsSync(filePath)) { | ||
return null | ||
} | ||
return new Promise((resolve, reject) => { | ||
try { | ||
this.checkRootFolder() | ||
const stream = readline.createInterface({ | ||
input: fs.createReadStream(filePath), | ||
crlfDelay: Infinity, | ||
}); | ||
const filePath = path.resolve(this.currentFolderPath, fileName) | ||
const stream = readline.createInterface({ | ||
input: fs.createReadStream(filePath), | ||
crlfDelay: Infinity, | ||
}); | ||
let lastLine = ''; | ||
let lastLine = ''; | ||
stream.on('line', (line) => { | ||
lastLine = line; | ||
}); | ||
stream.on('line', (line) => { | ||
lastLine = line; | ||
}); | ||
stream.on('close', () => { | ||
resolve(lastLine); | ||
}); | ||
stream.on('close', () => { | ||
resolve(lastLine); | ||
}); | ||
stream.on('error', (err) => { | ||
reject(err); | ||
}); | ||
} | ||
catch (err) { | ||
stream.on('error', (err) => { | ||
reject(err); | ||
} | ||
}); | ||
}); | ||
@@ -64,0 +63,0 @@ } |
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
4458
111