# map-name-find-api

> Basic library for Country, State and City

Latest version **0.0.2** (published 2019-07-17) · ISC license · 0 weekly downloads

## Install

```sh
npm install map-name-find-api
pnpm add map-name-find-api
yarn add map-name-find-api
bun add map-name-find-api
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2019-07-17 |
| First published | 2019-07-17 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.4 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Evgeny Gulyaev |
| Maintainers | evgeny_gulyaev |
| Keywords | country, city, state |

## Links

- npm: https://www.npmjs.com/package/map-name-find-api
- Repository: https://github.com/EvgenyGulyaev/countries-API
- Homepage: https://github.com/EvgenyGulyaev/countries-API#readme
- Issues: https://github.com/EvgenyGulyaev/countries-API/issues
- npm.io page: https://npm.io/package/map-name-find-api

## Dependencies (2)

- [lodash.find](https://npm.io/package/lodash.find.md) ^4.6.0
- [lodash.filter](https://npm.io/package/lodash.filter.md) ^4.6.0

## Alternatives

- [@reckona/mreact-store](https://npm.io/package/@reckona/mreact-store.md) — 976 weekly downloads
- [regular-state](https://npm.io/package/regular-state.md) — 410 weekly downloads
- [@pacote/flux-actions](https://npm.io/package/@pacote/flux-actions.md) — 65 weekly downloads
- [@pilotlab/lux-debug](https://npm.io/package/@pilotlab/lux-debug.md) — 39 weekly downloads
- [vue-persist-state](https://npm.io/package/vue-persist-state.md) — 19 weekly downloads

## Recent versions

- 0.0.2 (latest) — 2019-07-17
- 0.0.1 — 2019-07-17

## README

# map-name-find-api
Basic library for Country, State and City  Data taken from:https://github.com/hiiamrohit/Countries-States-Cities-database

# Installation
npm:    
`npm install map-name-find-api --save`     

yarn:     
`yarn add map-name-find-api`     

# Methods

## getData
```
Get All data from https://github.com/hiiamrohit/Countries-States-Cities-database
const API = require('map-name-find-api')
const data = API.getData();
console.log(data)
```

## getCitiesData
```
Get cities data from https://github.com/hiiamrohit/Countries-States-Cities-database
const API = require('map-name-find-api')
const data = API.getCitiesData();
console.log(data)
```

## getCountriesData
```
Get countries data from https://github.com/hiiamrohit/Countries-States-Cities-database
const API = require('map-name-find-api')
const data = API.getCountriesData();
console.log(data)
```

## getStatesData
```
Get states data from https://github.com/hiiamrohit/Countries-States-Cities-database
const API = require('map-name-find-api')
const data = API.getCountriesData();
console.log(data)
```

## getElementFromAllDataByName
```
Find element from all data by name(string) 
@params name

For example:   
const API = require('map-name-find-api')
const data = API.getElementFromAllDataByName('Taganrog');
console.log(data)

```

## getCities
```
Find cities from cities data by predicate as array 
@params [value, field], @default  field = state_id    
field can be  'state_id', 'name', 'id'

For example:   
const API = require('map-name-find-api')
const data = API.getCities(['805', 'state_id']); // or API.getCities(['805']);
console.log(data)
```

## getCountry
```
Find country from countries data by predicate as array 
@params [value, field], @default  field = sortname     
field can be  'id', 'sortname', 'name' , 'phoneCode' 

For example:   
const API = require('map-name-find-api')
const data = API.getCountry(['Afghanistan', 'sortname']); // or API.getCountry(['Afghanistan']);
console.log(data)
```

## getStates
```
Find state from states data by predicate as array 
@params [value, field], @default  field = country_id     
field can be  'id', 'name', 'country_id'

For example:   
const API = require('map-name-find-api')
const data = API.getStates(['101', 'country_id']); // or API.getStates(['101']);
console.log(data)
```

---
_Source: https://npm.io/package/map-name-find-api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
