job-pro 1.0.12 → 1.0.13
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/dist/index.js +25 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -127,7 +127,7 @@ USAGE
|
|
|
127
127
|
job-pro profile show print the loaded profile
|
|
128
128
|
job-pro find <keyword> search ALL 50 companies in parallel
|
|
129
129
|
[--limit N] [--companies a,b,c]
|
|
130
|
-
[--timeout ms] [--compact]
|
|
130
|
+
[--timeout ms] [--compact | --text]
|
|
131
131
|
job-pro --version
|
|
132
132
|
job-pro help
|
|
133
133
|
|
|
@@ -1087,9 +1087,10 @@ async function main() {
|
|
|
1087
1087
|
}
|
|
1088
1088
|
if (cmd === "find") {
|
|
1089
1089
|
const compact = args.includes("--compact");
|
|
1090
|
+
const textMode = args.includes("--text");
|
|
1090
1091
|
const keyword = args[1];
|
|
1091
1092
|
if (!keyword || keyword.startsWith("--")) {
|
|
1092
|
-
die(`usage: job-pro find <keyword> [--limit N] [--companies a,b,c] [--timeout ms] [--compact]`);
|
|
1093
|
+
die(`usage: job-pro find <keyword> [--limit N] [--companies a,b,c] [--timeout ms] [--compact | --text]`);
|
|
1093
1094
|
}
|
|
1094
1095
|
const { args: aLimit, value: limitStr } = popFlagValue(args, "--limit");
|
|
1095
1096
|
const { args: aCompanies, value: companiesStr } = popFlagValue(aLimit, "--companies");
|
|
@@ -1140,6 +1141,27 @@ async function main() {
|
|
|
1140
1141
|
const totalMs = Date.now() - startedAt;
|
|
1141
1142
|
const withHits = settled.filter((r) => r.count > 0);
|
|
1142
1143
|
const total = withHits.reduce((s, r) => s + r.count, 0);
|
|
1144
|
+
const failed = settled.filter((r) => !r.ok).map((r) => ({ company: r.company, message: r.message }));
|
|
1145
|
+
if (textMode) {
|
|
1146
|
+
console.log(`\nfind "${keyword}" — ${total} hit(s) across ${withHits.length}/${scope.length} companies (${totalMs}ms)\n`);
|
|
1147
|
+
for (const r of withHits) {
|
|
1148
|
+
console.log(`▌ ${r.company} (${r.count})`);
|
|
1149
|
+
for (const p of r.positions) {
|
|
1150
|
+
const title = (p.title ?? "").trim().replace(/\s+/g, " ");
|
|
1151
|
+
const loc = (p.work_cities ?? "").trim();
|
|
1152
|
+
console.log(` ${p.post_id ?? "?"} ${title}${loc ? ` — ${loc}` : ""}`);
|
|
1153
|
+
if (p.apply_url)
|
|
1154
|
+
console.log(` ${p.apply_url}`);
|
|
1155
|
+
}
|
|
1156
|
+
console.log("");
|
|
1157
|
+
}
|
|
1158
|
+
if (failed.length > 0) {
|
|
1159
|
+
console.log(`Failed (${failed.length}):`);
|
|
1160
|
+
for (const f of failed)
|
|
1161
|
+
console.log(` ${f.company}: ${f.message}`);
|
|
1162
|
+
}
|
|
1163
|
+
return;
|
|
1164
|
+
}
|
|
1143
1165
|
emit({
|
|
1144
1166
|
ok: true,
|
|
1145
1167
|
keyword,
|
|
@@ -1148,7 +1170,7 @@ async function main() {
|
|
|
1148
1170
|
scanned_companies: scope.length,
|
|
1149
1171
|
elapsed_ms: totalMs,
|
|
1150
1172
|
results: withHits,
|
|
1151
|
-
failed
|
|
1173
|
+
failed,
|
|
1152
1174
|
}, compact);
|
|
1153
1175
|
return;
|
|
1154
1176
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "job-pro",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13",
|
|
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",
|