@formepdf/cli 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.
- package/README.md +55 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# @formepdf/cli
|
|
2
|
+
|
|
3
|
+
Dev server and build tool for [Forme](https://github.com/formepdf/forme) PDF generation.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -D @formepdf/cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Commands
|
|
12
|
+
|
|
13
|
+
### `forme dev`
|
|
14
|
+
|
|
15
|
+
Live preview dev server with element inspector, component tree, click-to-source, and responsive page size switching.
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
forme dev invoice.tsx --data invoice-data.json
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Open `http://localhost:4242` to see your PDF update in real time as you edit.
|
|
22
|
+
|
|
23
|
+
### `forme build`
|
|
24
|
+
|
|
25
|
+
Render a PDF to a file.
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
forme build invoice.tsx --data invoice-data.json -o invoice.pdf
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Dev server features
|
|
32
|
+
|
|
33
|
+
- **Live preview** with hot reload on file changes
|
|
34
|
+
- **Element inspector** with box model, computed styles, and breadcrumb navigation
|
|
35
|
+
- **Component tree** showing document structure
|
|
36
|
+
- **Click-to-source** opens your editor (VS Code, Cursor, WebStorm, Zed) at the exact line
|
|
37
|
+
- **Responsive preview** with page size switching (Letter, A4, Legal, Tabloid, custom)
|
|
38
|
+
- **Data editor** for live JSON editing when using `--data`
|
|
39
|
+
- **Debug overlays** for margins, padding, and element bounds
|
|
40
|
+
|
|
41
|
+
## Options
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
forme dev <template> Start dev server
|
|
45
|
+
--data <file> Load JSON data file
|
|
46
|
+
--port <number> Server port (default: 4242)
|
|
47
|
+
|
|
48
|
+
forme build <template> Render PDF
|
|
49
|
+
--data <file> Load JSON data file
|
|
50
|
+
-o, --output <file> Output file path
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Docs
|
|
54
|
+
|
|
55
|
+
Full documentation at [docs.formepdf.com](https://docs.formepdf.com)
|