fpl-ts
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

A JS/TS wrapper for FPL API.

Installing fpl-ts

npm i fpl-ts

Docs

1. Classes & Methods

2. Types

3. Guides & Examples

Example

import { User, Player, Fixture, Team } from 'fpl-ts'

//  Get Fixture
const getFixtureDetails = async () => {
  const fixture = new Fixture(167)
  try {
    const details = await fixture.getDetails()
    console.log(details)
  } catch (err) {
    console.error(err)
  }
}

//  Get a player
const getPlayerDetails = async () => {
  const player = new Player([302])
  try {
    const bruno = await player.getDetails()
    console.log(bruno)
  } catch (err) {
    console.error(err)
  }
}

// Get user's details
const getUser = async () => {
  const user = new User(91928)
  try {
    const details = await user.getDetails()
    console.log(details)
  } catch (err) {
    console.error(err)
  }
}

Inspired by FPL

Package Sidebar

Install

npm i fpl-ts

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

90.7 kB

Total Files

29

Last publish

Collaborators

  • wamburu