Update dependencies
This includes eliminating some dependencies that are included in modern Node.js versions.
This commit is contained in:
parent
de47bd36e2
commit
ecdadf8fd9
9 changed files with 653 additions and 667 deletions
|
|
@ -1,6 +1,6 @@
|
|||
"use strict";
|
||||
const path = require("path");
|
||||
const fs = require("mz/fs");
|
||||
const fs = require("fs").promises;
|
||||
const throat = require("throat");
|
||||
const serializeToXML = require("xmlserializer").serializeToString;
|
||||
const { JSDOM } = require("jsdom");
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
"use strict";
|
||||
const path = require("path");
|
||||
const fs = require("mz/fs");
|
||||
const mkdirp = require("mkdirp-then");
|
||||
const fs = require("fs").promises;
|
||||
const request = require("requisition");
|
||||
const { JSDOM } = require("jsdom");
|
||||
|
||||
|
|
@ -35,7 +34,7 @@ async function downloadAllChapters(manifest, startChapterURL, cachePath, manifes
|
|||
manifest = [];
|
||||
}
|
||||
|
||||
await mkdirp(cachePath);
|
||||
await fs.mkdir(cachePath, { recursive: true });
|
||||
|
||||
while (currentChapter !== null) {
|
||||
const filename = `${FILENAME_PREFIX}${chapterIndex.toString().padStart(3, "0")}.html`;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"use strict";
|
||||
const fs = require("mz/fs");
|
||||
const fs = require("fs").promises;
|
||||
const path = require("path");
|
||||
const cpr = require("thenify")(require("cpr"));
|
||||
const cpr = require("util").promisify(require("cpr"));
|
||||
|
||||
const BOOK_TITLE = "Worm";
|
||||
const BOOK_AUTHOR = "wildbow";
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
"use strict";
|
||||
/* eslint-disable no-process-exit */
|
||||
const path = require("path");
|
||||
const mkdirp = require("mkdirp-then");
|
||||
const rimraf = require("rimraf-then");
|
||||
const fs = require("fs").promises;
|
||||
const yargs = require("yargs");
|
||||
|
||||
const packageJson = require("../package.json");
|
||||
|
|
@ -77,8 +76,8 @@ if (argv._.includes("download")) {
|
|||
|
||||
if (argv._.includes("convert")) {
|
||||
commands.push(() => {
|
||||
return rimraf(chaptersPath)
|
||||
.then(() => mkdirp(chaptersPath))
|
||||
return fs.rmdir(chaptersPath, { recursive: true })
|
||||
.then(() => fs.mkdir(chaptersPath, { recursive: true }))
|
||||
.then(() => convert(cachePath, manifestPath, chaptersPath, argv.jobs));
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue