podcast-dl 9.0.3 → 9.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/validate.js CHANGED
@@ -1,43 +1,43 @@
1
- import { sync as commandExistsSync } from "command-exists";
2
-
3
- import { logErrorAndExit } from "./logger.js";
4
-
5
- const createParseNumber = ({ min, max, name, required = true }) => {
6
- return (value) => {
7
- if (!value && !required) {
8
- return undefined;
9
- }
10
-
11
- try {
12
- let number = parseInt(value);
13
-
14
- if (isNaN(number)) {
15
- logErrorAndExit(`${name} must be a number`);
16
- }
17
-
18
- if (typeof min !== undefined && number < min) {
19
- logErrorAndExit(`${name} must be >= ${min}`);
20
- }
21
-
22
- if (typeof max !== undefined && number > max) {
23
- logErrorAndExit(
24
- `${name} must be <= ${
25
- max === Number.MAX_SAFE_INTEGER ? "Number.MAX_SAFE_INTEGER" : max
26
- }`
27
- );
28
- }
29
-
30
- return number;
31
- } catch (error) {
32
- logErrorAndExit(`Unable to parse ${name}`);
33
- }
34
- };
35
- };
36
-
37
- const hasFfmpeg = () => {
38
- if (!commandExistsSync("ffmpeg")) {
39
- logErrorAndExit('option specified requires "ffmpeg" be available');
40
- }
41
- };
42
-
43
- export { createParseNumber, hasFfmpeg };
1
+ import { sync as commandExistsSync } from "command-exists";
2
+
3
+ import { logErrorAndExit } from "./logger.js";
4
+
5
+ const createParseNumber = ({ min, max, name, required = true }) => {
6
+ return (value) => {
7
+ if (!value && !required) {
8
+ return undefined;
9
+ }
10
+
11
+ try {
12
+ let number = parseInt(value);
13
+
14
+ if (isNaN(number)) {
15
+ logErrorAndExit(`${name} must be a number`);
16
+ }
17
+
18
+ if (typeof min !== undefined && number < min) {
19
+ logErrorAndExit(`${name} must be >= ${min}`);
20
+ }
21
+
22
+ if (typeof max !== undefined && number > max) {
23
+ logErrorAndExit(
24
+ `${name} must be <= ${
25
+ max === Number.MAX_SAFE_INTEGER ? "Number.MAX_SAFE_INTEGER" : max
26
+ }`
27
+ );
28
+ }
29
+
30
+ return number;
31
+ } catch (error) {
32
+ logErrorAndExit(`Unable to parse ${name}`);
33
+ }
34
+ };
35
+ };
36
+
37
+ const hasFfmpeg = () => {
38
+ if (!commandExistsSync("ffmpeg")) {
39
+ logErrorAndExit('option specified requires "ffmpeg" be available');
40
+ }
41
+ };
42
+
43
+ export { createParseNumber, hasFfmpeg };
package/package.json CHANGED
@@ -1,62 +1,62 @@
1
- {
2
- "name": "podcast-dl",
3
- "version": "9.0.3",
4
- "description": "A CLI for downloading podcasts.",
5
- "type": "module",
6
- "bin": "./bin/bin.js",
7
- "scripts": {
8
- "build": "rimraf ./binaries && rimraf ./dist && node build.cjs",
9
- "lint": "eslint ./bin"
10
- },
11
- "lint-staged": {
12
- "*.{js,json,md}": [
13
- "prettier --write"
14
- ]
15
- },
16
- "husky": {
17
- "hooks": {
18
- "pre-commit": "lint-staged",
19
- "pre-push": "npm run lint"
20
- }
21
- },
22
- "keywords": [
23
- "podcast",
24
- "podcasts",
25
- "downloader",
26
- "cli"
27
- ],
28
- "engines": {
29
- "node": ">=14.17.6"
30
- },
31
- "repository": {
32
- "type": "git",
33
- "url": "https://github.com/lightpohl/podcast-dl.git"
34
- },
35
- "files": [
36
- "bin"
37
- ],
38
- "author": "Joshua Pohl",
39
- "license": "MIT",
40
- "devDependencies": {
41
- "eslint": "^6.8.0",
42
- "eslint-config-prettier": "^6.11.0",
43
- "husky": "^4.2.5",
44
- "lint-staged": "^10.1.7",
45
- "pkg": "^5.8.0",
46
- "prettier": "2.3.2",
47
- "rimraf": "^3.0.2",
48
- "webpack": "^5.75.0"
49
- },
50
- "dependencies": {
51
- "command-exists": "^1.2.9",
52
- "commander": "^5.1.0",
53
- "dayjs": "^1.8.25",
54
- "filenamify": "^6.0.0",
55
- "global-agent": "^3.0.0",
56
- "got": "^11.0.2",
57
- "p-limit": "^4.0.0",
58
- "pluralize": "^8.0.0",
59
- "rss-parser": "^3.12.0",
60
- "throttle-debounce": "^3.0.1"
61
- }
62
- }
1
+ {
2
+ "name": "podcast-dl",
3
+ "version": "9.2.0",
4
+ "description": "A CLI for downloading podcasts.",
5
+ "type": "module",
6
+ "bin": "./bin/bin.js",
7
+ "scripts": {
8
+ "build": "rimraf ./binaries && rimraf ./dist && node build.cjs",
9
+ "lint": "eslint ./bin"
10
+ },
11
+ "lint-staged": {
12
+ "*.{js,json,md}": [
13
+ "prettier --write"
14
+ ]
15
+ },
16
+ "husky": {
17
+ "hooks": {
18
+ "pre-commit": "lint-staged",
19
+ "pre-push": "npm run lint"
20
+ }
21
+ },
22
+ "keywords": [
23
+ "podcast",
24
+ "podcasts",
25
+ "downloader",
26
+ "cli"
27
+ ],
28
+ "engines": {
29
+ "node": ">=14.17.6"
30
+ },
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "https://github.com/lightpohl/podcast-dl.git"
34
+ },
35
+ "files": [
36
+ "bin"
37
+ ],
38
+ "author": "Joshua Pohl",
39
+ "license": "MIT",
40
+ "devDependencies": {
41
+ "eslint": "^6.8.0",
42
+ "eslint-config-prettier": "^6.11.0",
43
+ "husky": "^4.2.5",
44
+ "lint-staged": "^10.1.7",
45
+ "pkg": "^5.8.0",
46
+ "prettier": "2.3.2",
47
+ "rimraf": "^3.0.2",
48
+ "webpack": "^5.75.0"
49
+ },
50
+ "dependencies": {
51
+ "command-exists": "^1.2.9",
52
+ "commander": "^5.1.0",
53
+ "dayjs": "^1.8.25",
54
+ "filenamify": "^6.0.0",
55
+ "global-agent": "^3.0.0",
56
+ "got": "^11.0.2",
57
+ "p-limit": "^4.0.0",
58
+ "pluralize": "^8.0.0",
59
+ "rss-parser": "^3.12.0",
60
+ "throttle-debounce": "^3.0.1"
61
+ }
62
+ }