dsh-hashcheck 0.1.1 → 0.1.3

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/README.md +30 -0
  2. package/package.json +3 -2
package/README.md CHANGED
@@ -2,6 +2,36 @@
2
2
 
3
3
  A manifest records the SHA-256 of every file you delivered. Verification says which bytes moved since — a changed file, a missing file, and a file that was delivered but never listed are three different failures, and only the first two get caught by eyeballing a folder.
4
4
 
5
+ <!-- example:start -->
6
+ ## 真实输入输出
7
+
8
+ 输入:
9
+
10
+ ```markdown
11
+ delivery/
12
+ ├── report.md ← 交付后有人改了一个字
13
+ ├── nested.csv
14
+ └── hashcheck.json
15
+ ```
16
+
17
+ 真实运行(逐字输出,由测试与工具保持同步):
18
+
19
+ ```text
20
+ $ dsh-hashcheck build ./delivery
21
+ delivery/hashcheck.json: 2 files, sha256
22
+ $ dsh-hashcheck verify delivery/hashcheck.json --dir ./delivery
23
+ ok: 2 checked, 0 errors, 1 warnings
24
+
25
+ # 有人改了 report.md 之后再验:
26
+ $ dsh-hashcheck verify delivery/hashcheck.json --dir ./delivery
27
+ error changed report.md changed: expected d2f56516fd6c…, found 99527e917f49…
28
+ warn unlisted hashcheck.json is on disk but not in the manifest
29
+ fail: 2 checked, 1 errors, 1 warnings
30
+ ```
31
+
32
+ 出口码:改前 0,改后 1。
33
+ <!-- example:start -->
34
+
5
35
  ```bash
6
36
  npx dsh-hashcheck build ./delivery --out delivery/hashcheck.json --ignore node_modules
7
37
  npx dsh-hashcheck verify delivery/hashcheck.json --dir ./delivery
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-hashcheck",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "SHA-256 manifests for delivered files: build once, verify anywhere, and say exactly which bytes moved instead of 'looks fine'.",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -17,7 +17,8 @@
17
17
  }
18
18
  },
19
19
  "engines": {
20
- "node": ">=22.19.0"
20
+ "node": ">=22.19.0",
21
+ "dsh": ">=0.2.2-rc.1 <0.3.0-0"
21
22
  },
22
23
  "files": [
23
24
  "src",