central-cities

1.2.0 • Public • Published

Central Cities

NPM package to get the capital of the countries

npm npm NPM

Getting Started

Prerequisites

node -v
node: >= v8.3

Installing

Using npm

npm install --save central-cities
npm i central-cities

Using Yarn

yarn add central-cities

How to use

Importing with Commonjs style

const Countries = require('central-cities')
const countries = new Countries()

Importing with ES6 modules style

import Countries from 'central-cities'
const countries = new Countries()

Filter by name

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

Readme

Keywords

Package Sidebar

Install

npm i central-cities

Weekly Downloads

7

Version

1.2.0

License

MIT

Unpacked Size

37.1 kB

Total Files

7

Last publish

Collaborators

  • fernandobritto