soccer-ab

Information on Serie A players and teams

Usage no npm install needed!

<script type="module">
  import soccerAb from 'https://cdn.skypack.dev/soccer-ab';
</script>

README

soccer-ab

Information on Serie A players and teams

Installation

$ sudo npm i -g typescript
$ npm i express
$ npm i -D typescript ts-node nodemon @types/node @types/express
$ npm install --save soccer-ab

Function list

  • allTeams: List of all teams
  • teamAvaiable: Check if the team exists
  • allPlayersForTeam: List of all players of an input team
  • playerForTeam: Random player of an input team
  • allPlayers: List of all players
  • teamForPlayer: Given as input the name of the player to print the belonging team
  • playersForRole: List of all players with a certain role
  • playerRandom: Random player

Usage

import express from 'express';
import * as soccer from 'soccer-ab';
const app = express();

Basic usage

app.get('/players', (req, res, next) => {
    res.json(soccer.allPlayers());
    next();
});