laika-locations
v1.3.5
Published
Locations module for Laika project
Downloads
8
Maintainers
Readme
laika-locations
Installation
npm install laika-locations --save
Usage
TypeScript
import { getCitiesByCountry, getCountries } from 'laika-locations';
console.log(getCountries());
// returns
{
"countries": [
{
"id":1,
"name":"Macedonia",
"iso":"MK"
},
{
"id":2,
"name":"Croatia",
"iso":"HR"},
{
"id":3,
"name":"Bulgaria",
"iso":"BG"},
{
"id":4,
"name":"Serbia",
"iso":"RS"
}
]
}
console.log(getCitiesByCountry(1));
[ { id: 1, countryId: 1, name: 'Skopje' },
{ id: 2, countryId: 1, name: 'Arachinovo' },
{ id: 3, countryId: 1, name: 'Ohrid' },
{ id: 4, countryId: 1, name: 'Kumanovo' },
{ id: 5, countryId: 1, name: 'Tetovo' },
{ id: 6, countryId: 1, name: 'Bitola' },
{ id: 7, countryId: 1, name: 'Prilep' },
{ id: 8, countryId: 1, name: 'Veles' },
......
]