@ffflorian/xkcdjs 3.4.3 → 3.4.5

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.
Files changed (2) hide show
  1. package/dist/cli.js +8 -8
  2. package/package.json +3 -3
package/dist/cli.js CHANGED
@@ -43,15 +43,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
43
43
  });
44
44
  };
45
45
  Object.defineProperty(exports, "__esModule", { value: true });
46
+ const path = __importStar(require("node:path"));
47
+ const node_fs_1 = require("node:fs");
46
48
  const commander_1 = require("commander");
47
- const fs_1 = require("fs");
48
- const path = __importStar(require("path"));
49
+ const package_json_1 = require("../package.json");
49
50
  const _1 = require("./");
50
51
  function init() {
51
52
  return __awaiter(this, arguments, void 0, function* (dir = '.') {
52
53
  const resolvedPath = path.resolve(dir);
53
54
  try {
54
- yield fs_1.promises.access(resolvedPath, fs_1.constants.F_OK | fs_1.constants.R_OK);
55
+ yield node_fs_1.promises.access(resolvedPath, node_fs_1.constants.F_OK | node_fs_1.constants.R_OK);
55
56
  const xkcd = new _1.XKCD();
56
57
  return [resolvedPath, xkcd];
57
58
  }
@@ -65,16 +66,15 @@ function save(filePath, imageResult) {
65
66
  const { data, num, safe_title } = imageResult;
66
67
  const extension = data.mimeType ? data.mimeType.replace('image/', '') : 'png';
67
68
  const resolvedFilePath = path.resolve(filePath, `xkcd #${num} - ${safe_title}.${extension}`);
68
- yield fs_1.promises.writeFile(resolvedFilePath, data.data);
69
+ yield node_fs_1.promises.writeFile(resolvedFilePath, data.data);
69
70
  console.info(`Saved image to "${resolvedFilePath}".`);
70
71
  });
71
72
  }
72
- const { description, name, version } = require('../package.json');
73
73
  commander_1.program.on('command:*', () => commander_1.program.help());
74
74
  commander_1.program
75
- .name(name.replace(/^@[^/]+\//, ''))
76
- .version(version, '-v, --version')
77
- .description(description)
75
+ .name(package_json_1.name.replace(/^@[^/]+\//, ''))
76
+ .version(package_json_1.version, '-v, --version')
77
+ .description(package_json_1.description)
78
78
  .option('-o, --output <dir>', 'Specify the output directory', path.resolve('.'));
79
79
  commander_1.program
80
80
  .command('latest')
package/package.json CHANGED
@@ -31,8 +31,8 @@
31
31
  ],
32
32
  "license": "GPL-3.0",
33
33
  "name": "@ffflorian/xkcdjs",
34
- "repository": "https://github.com/ffflorian/api-clients.git",
35
34
  "readme": "https://github.com/ffflorian/api-clients#readme",
35
+ "repository": "https://github.com/ffflorian/api-clients.git",
36
36
  "scripts": {
37
37
  "build:ts": "tsc -p tsconfig.build.json",
38
38
  "build:docs": "typedoc --tsconfig tsconfig.build.json --options ../../typedoc.json --out ../../docs/packages/xkcdjs src/index.ts",
@@ -41,6 +41,6 @@
41
41
  "start": "tsx src/cli.ts",
42
42
  "test": "vitest"
43
43
  },
44
- "version": "3.4.3",
45
- "gitHead": "3a8697be82ab0cbb28bc02e420b52254146649b3"
44
+ "version": "3.4.5",
45
+ "gitHead": "8d7471cbe490305b3e441c27acbc81e36a4bd9df"
46
46
  }