epub-to-pdf-cli 1.0.2 → 1.0.4

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 (3) hide show
  1. package/bin/cli.js +7 -9
  2. package/package.json +28 -10
  3. package/test.js +0 -3
package/bin/cli.js CHANGED
@@ -1,13 +1,11 @@
1
- import { execSync } from 'child_process';
1
+ #!/usr/bin/env node
2
2
 
3
- try {
4
- execSync('ebook-convert --version', { stdio: 'ignore' });
5
- } catch {
6
- console.error(`
7
- ❌ Calibre is required.
3
+ import { convertEpubToPdf } from '../src/index.js';
8
4
 
9
- Install from:
10
- https://calibre-ebook.com/download
11
- `);
5
+ const input = process.argv[2];
6
+ if (!input) {
7
+ console.error('Usage: epub2pdf <file.epub>');
12
8
  process.exit(1);
13
9
  }
10
+
11
+ convertEpubToPdf(input);
package/package.json CHANGED
@@ -1,23 +1,41 @@
1
1
  {
2
2
  "name": "epub-to-pdf-cli",
3
- "version": "1.0.2",
4
- "description": "Convert EPUB files to PDF using Calibre",
3
+ "version": "1.0.4",
4
+ "description": "Convert EPUB files to PDF using Calibre (CLI tool)",
5
5
  "type": "module",
6
- "main": "src/index.js",
7
6
  "bin": {
8
7
  "epub2pdf": "./bin/cli.js"
9
8
  },
10
- "scripts": {
11
- "test": "node test.js",
12
- "prepublishOnly": "node scripts/prepublish.js"
13
- },
9
+ "main": "src/index.js",
10
+ "files": [
11
+ "bin",
12
+ "src",
13
+ "scripts",
14
+ "README.md"
15
+ ],
14
16
  "keywords": [
15
17
  "epub",
16
18
  "pdf",
17
- "ebook",
18
19
  "converter",
19
- "calibre"
20
+ "calibre",
21
+ "ebook",
22
+ "cli"
20
23
  ],
21
24
  "author": "Suraj Sutar",
22
- "license": "MIT"
25
+ "license": "MIT",
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "https://github.com/surajsutar7/epub-to-pdf-cli.git"
29
+ },
30
+ "bugs": {
31
+ "url": "https://github.com/surajsutar7/epub-to-pdf-cli/issues"
32
+ },
33
+ "homepage": "https://github.com/surajsutar7/epub-to-pdf-cli#readme",
34
+ "scripts": {
35
+ "prepublishOnly": "node scripts/prepublish.js",
36
+ "test": "node test.js"
37
+ },
38
+ "engines": {
39
+ "node": ">=18"
40
+ }
23
41
  }
package/test.js DELETED
@@ -1,3 +0,0 @@
1
- import { convertEpubToPdf } from './src/index.js';
2
-
3
- convertEpubToPdf('sample.epub');