@youtyan/code-viewer 0.1.16 → 0.1.17

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 CHANGED
@@ -2,7 +2,8 @@
2
2
 
3
3
  Local browser-based code and git diff viewer.
4
4
 
5
- Requires [Bun](https://bun.sh/) on your `PATH`.
5
+ Requires Node.js 20 or newer when installed from npm. Development uses
6
+ [Bun](https://bun.sh/).
6
7
 
7
8
  ## Features
8
9
 
@@ -16,27 +17,52 @@ Requires [Bun](https://bun.sh/) on your `PATH`.
16
17
 
17
18
  ## Usage
18
19
 
20
+ From inside a git repository, run it without installing:
21
+
22
+ ```sh
23
+ npx @youtyan/code-viewer
24
+ ```
25
+
26
+ The server prints a local URL. Add `--open` if you want the browser opened
27
+ automatically:
28
+
19
29
  ```sh
20
- bunx @youtyan/code-viewer --cwd /path/to/repo
30
+ npx @youtyan/code-viewer --open
21
31
  ```
22
32
 
23
- Or after installing globally:
33
+ To inspect another repository, pass `--cwd`:
34
+
35
+ ```sh
36
+ npx @youtyan/code-viewer --cwd /path/to/repo
37
+ ```
38
+
39
+ Equivalent one-shot commands also work:
40
+
41
+ ```sh
42
+ pnpm dlx @youtyan/code-viewer
43
+ bunx @youtyan/code-viewer
44
+ ```
45
+
46
+ Or install it globally:
24
47
 
25
48
  ```sh
26
49
  npm install -g @youtyan/code-viewer
27
- code-viewer --cwd /path/to/repo
50
+ code-viewer
28
51
  ```
29
52
 
30
- Arguments after options are passed to `git diff`. By default it compares
31
- `HEAD` with the working tree.
53
+ The published CLI runs on Node.js 20 or newer. Bun is supported as a package
54
+ runner through `bunx`, but the npm package no longer requires Bun at runtime.
55
+
56
+ Arguments after options are passed to `git diff`. By default, code-viewer
57
+ compares `HEAD` with the working tree.
32
58
 
33
59
  ```sh
60
+ npx @youtyan/code-viewer HEAD~1 HEAD
61
+ npx @youtyan/code-viewer --staged
34
62
  code-viewer HEAD~1 HEAD
35
63
  code-viewer --cwd /path/to/repo --staged
36
64
  ```
37
65
 
38
- Pass `--open` only when you want the browser opened automatically.
39
-
40
66
  ## Repository View
41
67
 
42
68
  Open the root URL to browse the repository tree. Folder pages keep the sidebar