2.3.3 • Published 2 years ago

team-finder v2.3.3

Weekly downloads
29
License
ISC
Repository
github
Last release
2 years ago

npm package npm downloads

team-finder

Finds NHL teams that match the given term.

Install

$ npm install team-finder

Usage

import { findTeam } from 'team-finder'

findTeam('Capitals').fullName // 'Washington Capitals'

API

findTeam

Returns a Team if a team is found, or null if not

import { findTeam } from 'team-finder'

findTeam('Washington').teamName // 'Capitals'
findTeam('Capitals').cityName // 'Washington'
findTeam('WSH').fullName // 'Washington Capitals'
findTeam('Caps').abbreviation // 'WSH'

// Case insensitive
findTeam('washington', { caseSensitive: false }).teamName // 'Capitals'
findTeam('wsh', {
  caseSensitive: {
    abbreviation: false,
    teamName: true
    cityName: true
  }
}).teamName // 'Capitals'

// Elliotte Friedman mode for his stubborn use of wrong abbreviations
findTeam('CAL', { friedman: true }).abbreviation // 'CGY'

teams

Returns an object containing all teams with abbreviations as the key

import { teams } from 'team-finder'

teams.ANA.cityName // 'Anaheim'
teams.BOS.fullName // 'Boston Bruins'

teamDictionary

An object where the keys are the terms/names/social media values, and the values are team abbreviations. findTeam used to use this under the hood. Will probably be removed in a later major version (3.x).

(note: this does not include friedmanAbbreviations of teams)

import { teamDictionary } from 'team-finder'

teamDictionary['Caps'] // 'WSH'
teamDictionary['@FlaPanthers'] // 'FLA'

License

MIT

2.3.2

2 years ago

2.3.3

2 years ago

2.3.1

4 years ago

2.3.0

4 years ago

2.2.2

4 years ago

2.2.1

5 years ago

2.2.0

5 years ago

2.1.2

5 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.1

5 years ago

2.0.0

6 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago