- 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)
}