mirror of
https://github.com/jakejarvis/careful-downloader.git
synced 2025-04-26 07:45:23 -04:00
fix node 12.x
This commit is contained in:
parent
b75aef6e80
commit
3325d61b62
1
.github/workflows/ci.yml
vendored
1
.github/workflows/ci.yml
vendored
@ -29,5 +29,4 @@ jobs:
|
||||
node-version: ${{ matrix.node }}
|
||||
- run: yarn install --frozen-lockfile
|
||||
- run: yarn audit
|
||||
- run: yarn lint
|
||||
- run: yarn test
|
||||
|
6
index.js
6
index.js
@ -11,13 +11,13 @@ import urlParse from "url-parse";
|
||||
export default async function downloader(downloadUrl, checksumUrl, options) {
|
||||
// normalize options and set defaults
|
||||
options = {
|
||||
filename: options.filename ?? urlParse(downloadUrl).pathname.split("/").pop(),
|
||||
filename: options.filename || urlParse(downloadUrl).pathname.split("/").pop(),
|
||||
extract: !!options.extract,
|
||||
tempDir: options.tempDir ? path.resolve(process.cwd(), options.tempDir) : tempy.directory(),
|
||||
destDir: options.destDir ? path.resolve(process.cwd(), options.destDir) : path.resolve(process.cwd(), "download"),
|
||||
cleanDestDir: !!options.cleanDestDir,
|
||||
algorithm: options.algorithm ?? "sha256",
|
||||
encoding: options.encoding ?? "binary",
|
||||
algorithm: options.algorithm || "sha256",
|
||||
encoding: options.encoding || "binary",
|
||||
};
|
||||
|
||||
try {
|
||||
|
@ -21,8 +21,7 @@
|
||||
"index.d.ts"
|
||||
],
|
||||
"scripts": {
|
||||
"lint": "eslint .",
|
||||
"test": "mocha"
|
||||
"test": "eslint . && mocha"
|
||||
},
|
||||
"dependencies": {
|
||||
"decompress": "^4.2.1",
|
||||
|
Loading…
x
Reference in New Issue
Block a user