New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

simple-countries-list

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-countries-list

Simple package for getting all world countries and their short names.

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

simple-countries-list

Simple package for getting all world countries and their short names.

Installation

npm i simple-countries-list

Usage

import {countryNames, countryShortNames, countries, getCountry} from 'simple-countries-list';

// returns an array of all country names in order
console.log(await countryNames()); //["Afghanistan", "Albania"....]

// returns an array of all country short names in order
console.log(await countryShortNames()); //["AF", "AL"....]

// returns an array of all countries and their short names in order
console.log(await countries()); // [{ name: "Afghanistan", shortName: "AF" } ...]

// returns a single country/shortName object
console.log(await getCountry("Nigeria"));  //{ name: "Nigeria", shortName: "NG" },

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Keywords

countries

FAQs

Package last updated on 06 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts