job-pro 1.0.30 → 1.0.31

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/dist/index.js +10 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -501,7 +501,15 @@ async function runCompany(adapter, company, rawArgs) {
501
501
  }
502
502
  const session = loadSession(company);
503
503
  const out = [];
504
+ // Progress to stderr (so stdout JSON stays clean for pipes). Only when
505
+ // not --compact AND not piping stdout (interactive TTY).
506
+ const showProgress = !compact && process.stderr.isTTY && postIds.length > 1;
507
+ let progressIdx = 0;
504
508
  for (const id of postIds) {
509
+ progressIdx++;
510
+ if (showProgress) {
511
+ process.stderr.write(`\r[${progressIdx}/${postIds.length}] ${id.padEnd(28)}\x1b[K`);
512
+ }
505
513
  try {
506
514
  const schemaResult = (await fetchSchema.call(adapter, id));
507
515
  if (!schemaResult.ok || !schemaResult.schema) {
@@ -536,6 +544,8 @@ async function runCompany(adapter, company, rawArgs) {
536
544
  out.push({ post_id: id, ok: false, message: err instanceof Error ? err.message : String(err) });
537
545
  }
538
546
  }
547
+ if (showProgress)
548
+ process.stderr.write(`\r\x1b[K`);
539
549
  const okCount = out.filter((r) => r.ok).length;
540
550
  return emit({ mode: debugUrl ? "batch-debug" : "batch-dry-run", company, total: out.length, ok_count: okCount, results: out }, compact);
541
551
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "job-pro",
3
- "version": "1.0.30",
3
+ "version": "1.0.31",
4
4
  "description": "Query Chinese big-tech campus recruiting from your terminal. 50 companies, all 50 live. 46 via each company's own API; the 4 with no public canonical feed (Hikvision, CICC, Cainiao, WeBank) surfaced via Liepin as a clearly-labeled third-party fallback. No signup, no token, no server.",
5
5
  "homepage": "https://job.ha7ch.com",
6
6
  "repository": "https://github.com/HA7CH/job-pro",