atlantix-countries
v1.0.7
Published
Essential countries data information for atlantix media inc projects
Maintainers
Readme
Atlantix Countries Library 🇨🇦 🇮🇳 🇨🇴 🇬🇧 🇵🇭 🇰🇿 🇪🇨
This library uses a small countries database with flags and names information. Will be helpful for Atlantix Media apps using countries based configurations. This library is based in rest-countries-project and will replace all the API Calls to this project in all our applications.
Installation 📦️
To install the library run:
$ npm i atlantix-countriesFunctions 🚀
- Get all countries names
import { getAllCountriesNames } from 'atlantix-countries';
console.log(getAllCountriesNames());
// output:
// [
// 'Antigua and Barbuda',
// 'Bhutan',
// 'Italy',
// 'Tuvalu',
// 'Anguilla',
// 'Australia',
// 'Belize',
// 'Vanuatu'
// ...
// ]- Get country by name
import { getCountryByName } from 'atlantix-countries';
console.log(getCountryByName('Colombia'));
// output
// {
// flags: {
// png: 'https://flagcdn.com/w320/co.png',
// svg: 'https://flagcdn.com/co.svg',
// alt: 'The flag of Colombia is composed of three horizontal bands of yellow, blue and red, with the yellow band twice the height of the other two bands.'
// },
// name: {
// common: 'Colombia',
// official: 'Republic of Colombia',
// nativeName: { spa: [Object] }
// },
// flag: '🇨🇴',
// timezone: '-05:00',
// code: '+57'
// }- Get SVG format flag by country name
import { getCountryByName } from 'atlantix-countries';
console.log(getSvgFlagByName('Colombia'));
// output
// { name: 'Colombia', flag: 'https://flagcdn.com/co.svg' }- Get Country Emoji by name
import { getIconEmojiByName } from 'atlantix-countries';
console.log(getIconEmojiByName('Colombia'));
// output
// { name: 'Colombia', icon: '🇨🇴' }- Get All Countries icons
import { getAllCountriesIcons } from 'atlantix-countries';
console.log(getAllCountriesIcons());
//output
// [
// { name: 'Réunion', icon: '🇷🇪' },
// { name: 'Chile', icon: '🇨🇱' },
// { name: 'Colombia', icon: '🇨🇴' },
// { name: 'Saudi Arabia', icon: '🇸🇦' },
// { name: 'Israel', icon: '🇮🇱' },
// { name: 'Germany', icon: '🇩🇪' },
// ...
// ]- Get All countries Flags
import { getAllCountriesFlags } from 'atlantix-countries';
console.log(getAllCountriesFlags());
//output
// [
// ...
// { name: 'Réunion', icon: '🇷🇪', svg: 'https://flagcdn.com/re.svg' },
// { name: 'Chile', icon: '🇨🇱', svg: 'https://flagcdn.com/cl.svg' },
// { name: 'Colombia', icon: '🇨🇴', svg: 'https://flagcdn.com/co.svg' },
// {
// name: 'Saudi Arabia',
// icon: '🇸🇦',
// svg: 'https://flagcdn.com/sa.svg'
// },
// ...
// ]
About 🧑💻
This repository is maintained by everyone at Atlantix Media Inc.
