JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 29
  • Score
    100M100P100Q55216F

A node wrapper for OverTrack

Package Exports

  • overtrack.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (overtrack.js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

OverTrack.js

npm GitHub issues

Installing

NOTE

Node 8.x is required

npm install --save overtrack.js

Example

const ot = require('overtrack.js')

ot.player('eeveea')
  .then((games) => console.log(games))
  .catch(console.error)

NOTE

I plan on writing better docs before release.

Methods

NOTE

All methods return Promises

ot.player(key)
ot.sr(key[, options])
ot.clientVersion()
ot.lastMatch(key)


ot.player(key)

Returns: Simple game object.
Example:
ot.player('eeveea')
  .then((games) => {
    const game = games[0]
    console.log('Simple game object:', game)
    return game.detailed()
  })
  .then((game) => console.log('Detailed game object:', game))
  .catch(console.error)

ot.sr(key[, options])

options
  • multipleAccounts: Boolean Default: false
Returns: Number or Array
  [
    { name: String, sr: Number },
    {...}
  ]
Example:
ot.sr('eeveea')
  .then((sr) => console.log(sr))
  .catch(console.error)

ot.sr('eeveea', { multipleAccounts: true })
  .then((accounts) => {
    const message = accounts
      .map((x) => `${x.name}: ${x.sr}`)
      .join('\n')
    console.log(message)
  })
  .catch(console.error)

ot.clientVersion()

Returns: Object
{
  message: String,
  number: String
}
Example:
ot.clientVersion()
  .then((version) => console.log(version.message))
  .catch(console.error)

ot.lastMatch(key)

NOTE

Some fields may be null.

Returns: Simple game object.
Example:
ot.lastMatch('eeveea')
  .then((game) => {
    console.log('Last match:', game)
    return game.detailed()
  })
  .then((game) => console.log('Detailed game object:', game))
  .catch(console.error)

Objects

simple

detailed


heroStatistics

{
  elims: Number,
  damage: Number,
  objectiveKills: Number,
  healing: Number,
  objectiveTime: Number,
  deaths: Number,
  tabHealth: Number,
  timePlayed: Number,
  specific: [
    { value: Number, name: String },
    {...}
  ]
}

heroesPlayed

[
  { hero: String, percent: Number },
  {...}
]

killfeed

NOTE

There are two different types of objects in the array kills, and resurrects.

  [
    {
      left: {
        hero: String,
        player: String,
        team: 'blue' || 'red'
      },
      resurrect: true,
      right: {
        hero: String,
        player: String,
        team: 'blue' || 'red'
      },
      timestamp: Number
    },
    {
      assisters: [
        String
      ],
      killicon: {
        hero: String,
        ability: String
      },
      left: {
        hero: String,
        player: String,
        team: 'blue' || 'red'
      },
      resurrect: false,
      right: {
        hero: String,
        player: String,
        team: 'blue' || 'red'
      },
      timestamp: Number
    },
    {...}
  ]

map

{
  name: String,
  type: String
}

misc

  customGame: Boolean || null,
  key: String || null,
  url: String|| null,
  userId: Number || null,
  user: String || null,
  player: String || null,
  json: String || null,
  viewable: Boolean || null

objectiveStages

This has not been parsed yet and is the raw info form overtarck api

result

{
  blue: {
    score: Number,
    outcome: String
  },
  red: {
    score: Number,
    outcome: String
  }
}

season

{
  name: String,
  number: Number,
  offSeason: Boolean
}

sr

{
  diff: Number,
  end: Number || null,
  name: String,
  start: Number || null
}

teams

{
  blue: {
    sr: Number,
    players: [
      { name: String, rank: String },
      {...}
    ]
  },
  red: {
    sr: Number,
    players: [
      { name: String, rank: String },
      {...}
    ]
  }
}

time

{
  start: Number,
  end: Number || null,
  length: Number
}

Development

Pull requests are welcome.

Linter

JavaScript Standard Style