diff options
Diffstat (limited to 'init.js')
-rw-r--r-- | init.js | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -1,4 +1,3 @@ -// GPLv3 License const fs = require("fs") const download = require("download") const cliProgress = require("cli-progress") @@ -9,7 +8,7 @@ const url = "http://images.mangafreak.net/downloads/Horimiya_" const chapters = 124 const bar = new cliProgress.SingleBar({}, cliProgress.Presets.legacy) -bar.start(chapters, 0, { speed: "N/A" }) +bar.start(chapters, 0, {speed: "N/A"}) const doc = new pdfkit({autoFirstPage: false}) doc.pipe(fs.createWriteStream("Horimiya.pdf")) @@ -20,7 +19,7 @@ fs.promises.rm("pages", {recursive: true, force: true}) .fill(null) .map((_, i) => i + 1) .map(n => download(url + n) - .pipe(unzipper.Extract({ path: "pages" })) + .pipe(unzipper.Extract({path: "pages"})) .promise() .then(_ => bar.increment()) ) @@ -28,7 +27,7 @@ fs.promises.rm("pages", {recursive: true, force: true}) .then(_ => bar.stop()) .then(_ => fs.promises.readdir("pages")) .then(files => files - .sort(new Intl.Collator(undefined, { numeric: true }).compare) + .sort(new Intl.Collator(undefined, {numeric: true}).compare) .map(file => "pages/" + file) .map(file => doc.openImage(file)) .forEach(img => doc.addPage({size: [img.width, img.height]}).image(img, 0, 0)) |