npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@visuallyjs/open-football-worldcup-datasource

v1.0.3

Published

Provides an API for retrieving information from a set of worldcup.json files as published by openfootball

Readme

Open Football Worldcup Datasource

Simple wrapper API around a set of json files published by openfootball on GitHub:

https://github.com/openfootball

This datasource is for use with the worldcup json files found in this repository:

https://github.com/openfootball/worldcup.json

Usage

npm i @visuallyjs/open-football-worldcup-datasource
import { WorldCupDatasource } from "@visuallyjs/open-football-worldcup-datasource"

// create a datasource
const dataSource = new WorldCupDatasource()

// and ask it things

dataSource.getGroups(2026).then(groups => console.log(g))

React

If you're using it in React you'll probably want to assign to a ref or a memo, eg

import { WorldCupDatasource } from "@visuallyjs/open-football-worldcup-datasource"
import { useMemo, useEffect, useState } from "react"

export default function MyComponent() {
    
    const ds = useMemo(() => new WorldCupDatasource())
    const [groups, setGroups] = useState([])
    
    useEffect(() => {
        ds.getGroups(2026).then(setGroups)
    })  
    
    return <>
        <h1>Groups</h1>
        <ul>{groups.map(group => <li>{group.name}</li>)}</ul>
    </>
}

Methods available

| Method | Return | Description | | :--- | :--- | :--- | | getGroups(year: number) | Promise<Array<Group>> | Gets group definitions for the given year | | getGroup(year: number, name: string) | Promise<Group> | Gets a specific group definition for the given year | | getGroupTeams(year: number, groupName: string) | Promise<Array<Team>> | Gets teams in the given group in the given year | | getTeams(year: number) | Promise<Array<Team>> | Gets all teams in the given year | | getSquads(year: number) | Promise<Array<Squad>> | Gets all squads in the given year | | getSquad(year: number, name: string) | Promise<Squad> | Gets a squad in the given year | | getTeam(year: number, name: string) | Promise<Team> | Gets a team for a given year, by name | | getMatches(year: number) | Promise<Array<Match>> | Gets all matches played in the given year | | getMatch(year: number, matchNumber: number) | Promise<Match> | Gets a match by number, played in the given year | | getStadiums(year: number) | Promise<Array<Stadium>> | Gets all stadiums used as venues in the given year | | getStadium(year: number, name: string) | Promise<Stadium> | Gets a stadium used as a venue in the given year | | getGroupMatches(year: number, groupName: string) | Promise<Array<Match>> | Gets all matches played in the given group in the given year | | getGroupStats(year: number, groupName: string) | Promise<GroupStats> | Collates and returns group info, fully populated team list and matches played in the group | | getFullMatchDetails(year: number, matchNumber: number) | Promise<MatchDetails> | Returns full match details including stadium, teams and squads |

Model

The following interfaces are defined in definitions.ts and represent the data returned by the datasource:

Match

Represents a football match.

  • round: The round of the match (e.g., "Round of 16", "Final").
  • num: The match number.
  • date: The date of the match.
  • time: The kickoff time.
  • team1: The name of the first team.
  • team2: The name of the second team.
  • score: The match Score.
  • goals1: List of Goals scored by team 1.
  • goals2: List of Goals scored by team 2.
  • group: The group name, if applicable.
  • ground: The stadium or ground name.

Score

Represents the score of a match.

  • ft: Full-time score [team1, team2].
  • ht: Half-time score [team1, team2].
  • et: Extra-time score [team1, team2], if applicable.
  • p: Penalty shootout score [team1, team2], if applicable.

Goal

Represents a goal scored during a match.

  • name: The name of the player who scored.
  • minute: The minute the goal was scored.
  • penalty: Whether the goal was a penalty.
  • owngoal: Whether the goal was an own goal.

Group

Represents a tournament group.

  • name: The name of the group.
  • teams: List of team names in the group.

Team

Represents a football team.

  • name: The name of the team.
  • continent: The continent the team belongs to (Continent).
  • fifa_code: FIFA country code.
  • flag_icon: URL or path to the flag icon.
  • flag_unicode: Unicode representation of the flag.
  • group: The group the team is assigned to.
  • confed: The confederation the team belongs to.
  • id: Unique identifier for the team.
  • isoCode: ISO country code.

Stadium

Represents a stadium where matches are played.

  • city: The city where the stadium is located.
  • name: The name of the stadium.
  • capacity: The spectator capacity.
  • timezone: The timezone of the stadium's location.
  • coords: Geographical coordinates.

Squad

Represents a national squad.

  • name: The name of the squad/team.
  • fifa_code: FIFA country code.
  • players: List of Players in the squad.

Player

Represents a football player.

  • name: The name of the player.
  • number: The player's jersey number.
  • pos: The player's position.
  • date_of_birth: The player's date of birth.
  • club: Club details ({ name: string, country: string }).

GroupStats

Collated data for a specific group.

  • group: Group information.
  • teams: List of Teams in the group.
  • matches: List of Matches played in the group.

MatchDetails

Full details for a match.

  • match: Basic Match data.
  • team1: Full Team details for team 1.
  • team2: Full Team details for team 2.
  • stadium: Stadium details.
  • squad1: Squad details for team 1.
  • squad2: Squad details for team 2.