Skip to content

Latest commit

 

History

History
23 lines (20 loc) · 403 Bytes

USAGE.md

File metadata and controls

23 lines (20 loc) · 403 Bytes

Usage

  • Importing the entire nhl.js library
import nhl from 'nhl.js'
// or
const nhl = require('nhl.js')
  • All API methods will return a promise
nhl.players.player({ playerID: PLAYER_ID }).then(data => {
  console.log(data)
})
  • ES7 async/await can also be used
async function() {
  const data = await nhl.players.player({ playerID: PLAYER_ID })
  console.log(data)
}