# central-cities

> NPM package to get the capital of the countries

Latest version **1.2.0** (published 2020-11-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install central-cities
pnpm add central-cities
yarn add central-cities
bun add central-cities
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2020-11-25 |
| First published | 2020-11-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 36.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Fernando Britto |
| Maintainers | fernandobritto |
| Keywords | countries, capitals |

## Links

- npm: https://www.npmjs.com/package/central-cities
- Repository: https://github.com/fernandobritto/central-cities
- Homepage: https://github.com/fernandobritto/central-cities#readme
- Issues: https://github.com/fernandobritto/central-cities/issues
- npm.io page: https://npm.io/package/central-cities

## Dependencies (1)

- [random-item](https://npm.io/package/random-item.md) 3.1.0

## Recent versions

- 1.2.0 (latest) — 2020-11-25
- 1.1.0 — 2020-11-21
- 1.0.0 — 2020-11-21

## README

# Central Cities
NPM package to get the capital of the countries


![npm](https://img.shields.io/npm/v/central-cities?style=flat-square)
![npm](https://img.shields.io/npm/dm/central-cities?style=flat-square)
![NPM](https://img.shields.io/npm/l/central-cities?style=flat-square)


## Getting Started

### Prerequisites

```sh
node -v
node: >= v8.3
```

## Installing

#### Using npm
```sh
npm install --save central-cities
npm i central-cities
```

#### Using Yarn
```sh
yarn add central-cities
```


## How to use

#### Importing with Commonjs style

```javascript
const Countries = require('central-cities')
const countries = new Countries()
```

#### Importing with ES6 modules style

```javascript
import Countries from 'central-cities'
const countries = new Countries()
```

#### Filter by name

```javascript

const portugal = countries.byName('portugal')

/**
 * Get all country data
 [{
    "country": "Portugal",
    "city": "Lisboa",
    "independence": "1143",
    "location": "Southern Europe"
 }]
*/
portugal.toJson()

// get capital
portugal.capital // Lisboa

```

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