0.5.0 • Published 6 years ago

newsapi-label-dict v0.5.0

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

NewsAPI Label Dictionary

A tiny library that translates NewsAPI (ISO 3166-1) country and category labels into readable strings

Installation

npm install --save newsapi-label-dict

OR

yarn add newsapi-label-dict

Usage

Usage is very straightforward

import * as dict from 'newsapi-label-dict'

dict.countries.ru
>> Russia

dict.categories.sports
>> Sports

dict.languages.es
>> Spanish

dict.getCountry('ru')
>> Russia

dict.getCategory('sports')
>> Sports

dict.getLanguage('es')
>> Spanish

dict.getObject('language') // language, country, category
>> {
  fr: "French",
  en: "English",
  ...
}

dict.languageKeys
>> [
  'en',
  'es',
  'fr',
  ...
]
// This function also applies to `countryKeys` and `categoryKeys`

License

MIT

Translations

Currnent language is English, I might add translations in the future. Any pull requests for this feature will be accepted.

Contributing

Any pull requests welcome

0.5.0

6 years ago

0.4.2

6 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.0

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago