1.1.4 • Published 2 years ago
cloud-regions-country-flags v1.1.4
cloud-regions-country-flags
A library to convert cloud provider regions to locations and emoji flags.
Install
npm install cloud-regions-country-flags --save
Usage (fromProvider)
import { fromProvider } from 'cloud-regions-country-flags';
fromProvider('eu-north-1', 'AWS');
// Output
{
location: 'Europe (Stockholm)',
flag: '🇸🇪',
country: 'Sweden',
latitude: 59.331325231594654,
longitude: 18.0904021557263,
raw: 'eu-north-1'
}
fromProvider('us-west2-a', 'GCP');
// Output
{
location: 'Los Angeles, California, North America',
flag: '🇺🇸',
country: 'United States of America',
latitude: 34.04292305028126,
longitude: -118.21813240055846,
raw: 'us-west2-a'
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
region | string | true | code of region |
provider | AWS / GCP / Vercel | true | name of provider |
Region Information
Usage (fromISO)
import { fromISO } from 'cloud-regions-country-flags';
fromISO('KE');
// Output
{
country: 'Kenya',
flag: '🇰🇪',
latitude: 0.373810884212869,
longitude: 37.98094909161015,
raw: 'KE'
}
fromISO('VI');
// Output
{
country: 'Virgin Islands (U.S.)',
flag: '🇻🇮',
latitude: 17.734242029786145,
longitude: -64.71190436798027,
raw: 'VI'
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
entry | string | true | ISO code |
ISO Information
Bugs
There has been a lot of copy and pasting of values from various sources to create this utility. If you spot anything that is incorrect please open an issue or PR. Thanks in advance!
1.1.4
2 years ago
1.1.3
2 years ago
1.1.2
2 years ago
1.1.1
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago
0.0.13
2 years ago
0.0.12
2 years ago
0.0.11
2 years ago
0.0.10
2 years ago
0.0.9
2 years ago
0.0.8
2 years ago
0.0.7
2 years ago
0.0.6
2 years ago
0.0.5
2 years ago
0.0.4
2 years ago
0.0.3
2 years ago
0.0.2
2 years ago
0.0.1
2 years ago