1.0.2 • Published 1 year ago

simple-countries-list v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

simple-countries-list

Simple package for getting all world countries and their short names.

Installation

npm i simple-countries-list

Usage

import {countryNames, countryShortNames, countries, getCountry} from 'simple-countries-list';

// returns an array of all country names in order
console.log(await countryNames()); //["Afghanistan", "Albania"....]

// returns an array of all country short names in order
console.log(await countryShortNames()); //["AF", "AL"....]

// returns an array of all countries and their short names in order
console.log(await countries()); // [{ name: "Afghanistan", shortName: "AF" } ...]

// returns a single country/shortName object
console.log(await getCountry("Nigeria"));  //{ name: "Nigeria", shortName: "NG" },

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago