Preload every league, then count teams
{
"aaf": 8,
"ahl": 61,
"ajhl": 17,
"bchl": 23,
"cchl": 13,
"cebl": 15,
"cfb": 687,
"cfl": 9,
"chl": 41,
"cricket": 111,
"easl": 12,
"echl": 59,
"f1": 31,
"fiba": 30,
"gojhl": 45,
"iihf": 16,
"kijhl": 23,
"lba": 24,
"mbb": 366,
"mhl": 13,
"milb": 286,
"mjhl": 19,
"mlb": 30,
"nba": 30,
"nbagl": 32,
"nbl": 10,
"ncaa_baseball": 414,
"ncaa_mhockey": 110,
"ncaa_softball": 415,
"ncaa_whockey": 48,
"nfl": 32,
"nhl": 32,
"nojhl": 27,
"ohl": 27,
"ojhl": 28,
"phf": 8,
"pwhl": 12,
"qmjhl": 26,
"sjhl": 13,
"soccer": 2681,
"sphl": 16,
"ufl": 11,
"usfl": 9,
"ushl": 17,
"vijhl": 12,
"wbb": 364,
"whl": 23,
"wnba": 15,
"xfl": 11
}import { LEAGUES, preloadAll, teams } from "@sportsdataverse/sdvplot";
// Every league shard plus the gsis map, so every *Sync function works for any league afterwards.
// A server does this once at start-up; a browser page loads only the leagues it draws.
await preloadAll();
const counts: Record<string, number> = {};
for (const league of LEAGUES) counts[league] = (await teams(league)).length;
counts;
Tags: node · preloadAll · teams. All sdvplot examples.