@k-dang/pdf-tools 0.1.0 → 0.1.1

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/dist/cli.js +30 -30
  2. package/package.json +4 -9
  3. package/README.md +0 -98
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k-dang/pdf-tools",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "bin": {
@@ -25,19 +25,14 @@
25
25
  "cli",
26
26
  "bun"
27
27
  ],
28
- "devDependencies": {
29
- "@types/bun": "latest",
30
- "prettier": "3.7.4",
31
- "typescript": "^5"
32
- },
28
+ "devDependencies": {},
33
29
  "dependencies": {
34
30
  "meow": "^14.0.0",
35
- "pdf-lib": "^1.17.1"
31
+ "@k-dang/utils": "0.1.0"
36
32
  },
37
33
  "scripts": {
38
34
  "dev": "bun run cli.ts",
39
35
  "build": "bun run scripts/build.ts",
40
- "check": "tsc --noEmit",
41
- "format": "prettier --write ."
36
+ "check": "tsc --noEmit"
42
37
  }
43
38
  }
package/README.md DELETED
@@ -1,98 +0,0 @@
1
- # pdf-tools
2
-
3
- A fast CLI tool to extract specific pages from PDF files and merge multiple PDFs, powered by Bun.
4
-
5
- ## Features
6
-
7
- - Extract single pages or page ranges from PDFs
8
- - Support for complex page specifications (e.g., `"1,3,5-8"`)
9
- - Merge multiple PDFs into a single file
10
- - Fast file operations using Bun runtime
11
- - Built with TypeScript for type safety
12
-
13
- ## Installation
14
-
15
- **Requires Bun runtime.** Install [Bun](https://bun.sh) first, then:
16
-
17
- ```bash
18
- bun install -g @k-dang/pdf-tools
19
- ```
20
-
21
- ## Usage
22
-
23
- ### Extract Pages
24
-
25
- ```bash
26
- pdf-tools split <input-file> --pages <pages> [--output <output-file>]
27
- ```
28
-
29
- #### Options
30
-
31
- - `--pages`, `-p` - **Required.** Page numbers or ranges (e.g., `"6-8"` or `"1,3,5-8"`)
32
- - `--output`, `-o` - Output filename (defaults to `<input>_split.pdf`)
33
-
34
- #### Examples
35
-
36
- Extract pages 6-8 from a PDF:
37
-
38
- ```bash
39
- pdf-tools split document.pdf --pages 6-8
40
- ```
41
-
42
- Extract specific pages and ranges:
43
-
44
- ```bash
45
- pdf-tools split document.pdf --pages "1,3,5-8" --output extracted.pdf
46
- ```
47
-
48
- Extract a single page:
49
-
50
- ```bash
51
- pdf-tools split document.pdf --pages 10 --output page10.pdf
52
- ```
53
-
54
- ### Merge PDFs
55
-
56
- ```bash
57
- pdf-tools merge <file1.pdf> <file2.pdf> [file3.pdf ...] [--output <output-file>]
58
- ```
59
-
60
- #### Merge Options
61
-
62
- - `--output`, `-o` - Output filename (defaults to `merged.pdf`)
63
-
64
- #### Merge Examples
65
-
66
- Merge two PDFs:
67
-
68
- ```bash
69
- pdf-tools merge document1.pdf document2.pdf
70
- ```
71
-
72
- Merge multiple PDFs with custom output:
73
-
74
- ```bash
75
- pdf-tools merge file1.pdf file2.pdf file3.pdf --output combined.pdf
76
- ```
77
-
78
- ## Page Range Format
79
-
80
- - Single page: `"6"`
81
- - Page range: `"6-8"` (includes pages 6, 7, and 8)
82
- - Multiple pages/ranges: `"1,3,5-8"` (pages 1, 3, 5, 6, 7, 8)
83
-
84
- ## Development
85
-
86
- ### Prerequisites
87
-
88
- You need [Bun](https://bun.sh) installed to develop this tool:
89
-
90
- ```bash
91
- curl -fsSL https://bun.sh/install | bash
92
- ```
93
-
94
- ### Setup
95
-
96
- ```bash
97
- bun install
98
- ```