wtf-plugin-mlb

baseball data plugin for wtf_wikipedia

Usage no npm install needed!

<script type="module">
  import wtfPluginMlb from 'https://cdn.skypack.dev/wtf-plugin-mlb';
</script>

README

a plugin for wtf_wikipedia

npm install wtf-plugin-mlb

wtf-mlb gets structured data for mlb baseball teams, supports a bunch of different variants of mlb game log variations, and tries to cleanup some complicated parts of wikipedia sometimes in the wild.

const plugin = require('wtf-plugin-mlb')
wtf.extend(plugin)
wtf.getSeason('Toronto Blue Jays', 2018).then((data) => {
  console.log(data)
  /*{
  games: [{
      date: 'April 1',
      team: 'Reds',
      home: false,
      result: { us: 6, them: 5, win: true },
      record: { wins: 3, losses: 0, games: 3
    },
    ...
  ],
  postseason: [...],
  roster: [],
  draftPicks: [],
  playerStats: [] 
}*/
})

MIT