@dev-pi2pie/word-counter 0.1.3 → 0.1.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.
- package/README.md +34 -4
- package/dist/esm/bin.mjs +1878 -1616
- package/dist/esm/bin.mjs.map +1 -1
- package/dist/esm/worker/count-worker.mjs +1370 -0
- package/dist/esm/worker/count-worker.mjs.map +1 -0
- package/dist/esm/worker-pool.mjs +187 -0
- package/dist/esm/worker-pool.mjs.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -139,6 +139,33 @@ word-counter --path ./examples/test-case-multi-files-support --keep-progress
|
|
|
139
139
|
|
|
140
140
|
Progress is transient by default, auto-disabled for single-input runs, and suppressed in `--format raw` and `--format json`.
|
|
141
141
|
|
|
142
|
+
### Batch Concurrency (`--jobs`)
|
|
143
|
+
|
|
144
|
+
Use `--jobs` to control batch concurrency:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
word-counter --path ./examples/test-case-multi-files-support --jobs 1
|
|
148
|
+
word-counter --path ./examples/test-case-multi-files-support --jobs 4
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Quick policy:
|
|
152
|
+
|
|
153
|
+
- no `--jobs` and `--jobs 1` are equivalent baseline behavior.
|
|
154
|
+
- `--jobs 1`: async main-thread `load+count` baseline.
|
|
155
|
+
- `--jobs > 1`: worker `load+count` with async fallback when workers are unavailable.
|
|
156
|
+
- if requested `--jobs` exceeds host `suggestedMaxJobs` (from `--print-jobs-limit`), the CLI warns and runs with the suggested limit as a safety cap.
|
|
157
|
+
- use `--quiet-warnings` to suppress non-fatal warning lines (for example jobs-limit advisory and worker-fallback warning).
|
|
158
|
+
|
|
159
|
+
Inspect host jobs diagnostics:
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
word-counter --print-jobs-limit
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
`--print-jobs-limit` must be used alone (no other inputs or runtime flags).
|
|
166
|
+
|
|
167
|
+
For full policy details, JSON parity expectations (`--misc`, `--total-of whitespace,words`), and benchmark standards, see [`docs/batch-jobs-usage-guide.md`](docs/batch-jobs-usage-guide.md).
|
|
168
|
+
|
|
142
169
|
### Stable Path Resolution Contract
|
|
143
170
|
|
|
144
171
|
- Repeated `--path` values are accepted as mixed inputs (file + directory).
|
|
@@ -197,6 +224,8 @@ For additional usage details and troubleshooting, see [`docs/regex-usage-guide.m
|
|
|
197
224
|
|
|
198
225
|
### Debugging Diagnostics (`--debug`)
|
|
199
226
|
|
|
227
|
+
Noise policy: default output shows errors + warnings; `--debug` enables diagnostics; `--verbose` enables per-item diagnostics; `--quiet-warnings` suppresses warnings.
|
|
228
|
+
|
|
200
229
|
`--debug` remains the diagnostics gate and now defaults to `compact` event volume:
|
|
201
230
|
|
|
202
231
|
- lifecycle/stage timing events
|
|
@@ -229,7 +258,7 @@ word-counter --path ./examples/test-case-multi-files-support --debug --debug-rep
|
|
|
229
258
|
word-counter --path ./examples/test-case-multi-files-support --debug --debug-report ./logs/debug.jsonl --debug-tee
|
|
230
259
|
```
|
|
231
260
|
|
|
232
|
-
Skip details stay debug-gated and can
|
|
261
|
+
Skip details stay debug-gated and can be suppressed with `--quiet-skips`.
|
|
233
262
|
|
|
234
263
|
## How It Works
|
|
235
264
|
|
|
@@ -468,8 +497,9 @@ Example (trimmed):
|
|
|
468
497
|
"frontmatterType": "yaml",
|
|
469
498
|
"total": 7,
|
|
470
499
|
"items": [
|
|
471
|
-
{ "name": "content", "source": "frontmatter", "result": { "total":
|
|
472
|
-
{ "name": "content", "source": "
|
|
500
|
+
{ "name": "content", "source": "frontmatter", "result": { "total": 4 } },
|
|
501
|
+
{ "name": "content", "source": "frontmatter", "result": { "total": 2 } },
|
|
502
|
+
{ "name": "content", "source": "content", "result": { "total": 5 } }
|
|
473
503
|
]
|
|
474
504
|
}
|
|
475
505
|
```
|
|
@@ -562,7 +592,7 @@ word-counter --include-whitespace "Hi\tthere\n"
|
|
|
562
592
|
word-counter --misc "Hi\tthere\n"
|
|
563
593
|
```
|
|
564
594
|
|
|
565
|
-
In the CLI, `--include-whitespace` implies
|
|
595
|
+
In the CLI, `--include-whitespace` implies `--non-words` (same behavior as `--misc`). `--non-words` alone does not include whitespace. When enabled, whitespace counts appear under `nonWords.whitespace`, and `total = words + nonWords` (emoji + symbols + punctuation + whitespace). JSON output also includes top-level `counts` when `nonWords` is enabled. See `docs/schemas/whitespace-categories.md` for how whitespace is categorized.
|
|
566
596
|
|
|
567
597
|
Example JSON (trimmed):
|
|
568
598
|
|