# countrydata

> A library for getting data about countries.

Latest version **3.0.1** (published 2020-12-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install countrydata
pnpm add countrydata
yarn add countrydata
bun add countrydata
```

## 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 | 3.0.1 |
| Published | 2020-12-04 |
| First published | 2016-04-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 182.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Andy Burke |
| Maintainers | andyburke |
| Keywords | country, iso3166 |

## Links

- npm: https://www.npmjs.com/package/countrydata
- Repository: https://github.com/andyburke/countrydata
- Homepage: https://github.com/andyburke/countrydata#readme
- Issues: https://github.com/andyburke/countrydata/issues
- npm.io page: https://npm.io/package/countrydata

## Recent versions

- 3.0.1 (latest) — 2020-12-04
- 3.0.0 — 2020-08-25
- 2.0.1 — 2016-10-11
- 2.0.0 — 2016-10-11
- 1.0.0 — 2016-04-22

## README

## countrydata

A library for getting data about countries.

## Code Example

```javascript
const countrydata = require( 'countrydata' );

// look up country data by ISO3166 alpha3 code (default and fastest lookup)
const usa = countrydata.get( 'USA' );

// look up country by ISO3166 alpha2
const usa_by_alpha2 = countrydata.get( 'US' );

// look up country by ISO3166 numeric
const usa_by_numeric = countrydata.get( 840 );

// .all() will return an array of all countries
const countries_using_usd = countrydata.all().filter( country => {
    return country.currencies.some( ( currency ) => ( currency.code === 'USD' ) );
} );

const usa_by_find = countrydata.all().find( country => {
    return country.name.en && country.name.en === 'United States';
} );
```

## Installation

```bash
npm install --save countrydata
```

## Tests

```bash
npm run test
```

## Contributing

Contributions are encouraged and appreciated. To make the process as quick and painless as possible for everyone involved, here's a checklist that will make a pull request easily accepted:

1. Implement your new feature or bugfix
2. Add or update tests to ensure coverage
3. Ensure your code passes eslint using the included .eslintrc
4. Ensure your code is formatted according to the .eslintrc
5. Submit

## License

MIT

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