Make it work on nodejs 13
This commit is contained in:
16
main.js
16
main.js
@@ -289,8 +289,10 @@ db.all("select metadata from 'bookinfo'", function(err, rows) {
|
||||
//var HtmlFile = path.join(os.tmpdir(), title.replace(/\s+/g, '-') + '.html');
|
||||
var HtmlFile = title.replace(/\s+/g, '-') + '.html';
|
||||
|
||||
fs.writeFile(HtmlFile, HtmlHeader);
|
||||
console.log("created the file with HTML headers.");
|
||||
fs.writeFile(HtmlFile, HtmlHeader, (err) => {
|
||||
if (err) throw err;
|
||||
console.log("created the file with HTML headers.");
|
||||
});
|
||||
|
||||
db.all("select id, piece, other from 'fragments' where asin='" + asin + "' order by id", function(err, rows) {
|
||||
rows.forEach(function (row) {
|
||||
@@ -309,11 +311,15 @@ db.all("select metadata from 'bookinfo'", function(err, rows) {
|
||||
'dataUrl="' + image + '"',
|
||||
'src="' + imageDataMap[image] + '"');
|
||||
}
|
||||
fs.appendFile(HtmlFile, uncompressedFragmentData);
|
||||
fs.appendFile(HtmlFile, uncompressedFragmentData, (err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
fs.appendFile(HtmlFile, '</body></html>');
|
||||
console.log("created the file at: " + HtmlFile);
|
||||
fs.appendFile(HtmlFile, '</body></html>', (err) =>{
|
||||
if (err) throw err;
|
||||
console.log("created the file at: " + HtmlFile);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user