]> git.lizzy.rs Git - horimiya-dl.git/blobdiff - init.js
Style fixes
[horimiya-dl.git] / init.js
diff --git a/init.js b/init.js
index f62021c83afb539ef58e9e8d2ff9d8aa64d27042..c64f6d78b71d51891695ce1563b09ca615b492b5 100644 (file)
--- a/init.js
+++ b/init.js
@@ -1,16 +1,14 @@
-// GPLv3 License
 const fs = require("fs")
 const download = require("download")
 const cliProgress = require("cli-progress")
 const unzipper = require("unzipper")
 const pdfkit = require("pdfkit")
-const sharp = require("sharp")
 
 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"))
@@ -21,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())     
                )
@@ -29,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))