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 🙏

© 2024 – Pkg Stats / Ryan Hefner

all-country-football-leagues

v1.0.4

Published

A lightweight npm package for managing football league data. It includes functions to retrieve a complete list of leagues, count the total number of leagues, find a league by its name, and search for leagues based on name.

Downloads

8

Readme

all-country-football-leagues

All Country Football League

A lightweight npm package for managing football league data. It includes functions to retrieve a complete list of leagues, count the total number of leagues, find a league by its name, and search for leagues based on name.

Sample Usage

Drop down select field for all football Leagues

Installation

Install the package using npm:


npm i all-country-football-leagues

usage

import { getAllLeagues, getTotalLeagues, findLeagueByName, searchLeagues} from 'all-country-football-leagues';


//getAllLeagues()
//Retrieves a complete list of all football leagues.
const leagues = getAllLeagues();
console.log('All Leagues:', leagues);

//getTotalLeagues()
//Returns the total number of leagues available.
const totalLeagues = getTotalLeagues();
console.log(totalLeagues); // e.g., 100

//findLeagueByName(name)
const league = findLeagueByName('Ligue 1');
console.log(league);

//searchLeaguesByName(query)
const results = searchLeaguesByName('Premier League');
console.log(results);

Data Structure

Each item in the data array contains the following fields:

country: An object representing the country associated with the league.

code: A string representing the country code (e.g., "FR").

flag: A URL pointing to the country's flag image (e.g., "https://media.api-sports.io/flags/fr.svg").

name: The name of the country (e.g., "France").

id: A unique identifier for the league (e.g., 1).

name: The name of the league (e.g., "Ligue 1").

logo: A URL pointing to the league's logo (e.g., "https://media.api-sports.io/football/leagues/61.png").

type: The type of competition, typically "League".

Contributing

Contributions are welcome! If you would like to contribute to this project, please follow these steps:

  1. Fork the Repository: Click on the 'Fork' button at the top right of this page to create a copy of this repository in your GitHub account.

  2. Clone the Repository: Clone the forked repository to your local machine using the following command:


git clone https://github.com/your-username/all-country-football-leagues.git

Replace your-username with your GitHub username.

  1. Create a New Branch: Create a new branch for your feature or bug fix:

git checkout -b feature-branch-name

Replace feature-branch-name with a descriptive name for your branch.

  1. Make Your Changes: Implement your changes to the code.

  2. Commit Your Changes: Commit your changes with a clear and descriptive commit message:


git add .
git commit -m "Description of changes"
  1. Push Your Changes: Push your changes to your forked repository:

git push origin feature-branch-name
  1. Submit a Pull Request: Go to the original repository on GitHub and create a new pull request. Provide a clear description of your changes and why they should be merged.

  2. Review and Feedback: Your pull request will be reviewed, and feedback may be provided. Make any necessary changes, and once approved, your changes will be merged into the main branch.

GitHub Repository

[Git Repository](https://github.com/peter-sq/all-country-football-leagues.git

NPM Package

NPM Package Repository

License

This package is licensed under the MIT License. Feel free to use it in your own projects.

**Free Package, by Peter Awe! **