Socket
Book a DemoInstallSign in
Socket

easy-countries-list

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

easy-countries-list

Easy countries list manager

1.1.0
latest
npmnpm
Version published
Weekly downloads
27
-37.21%
Maintainers
1
Weekly downloads
 
Created
Source

Easy Countries List npm version Build Status

This package is a easy standar countries list.

Salesforce and Zuora used this countries list.

Installation

npm i --save easy-countries-list

Usage

Function:

  • Get all countries:

import EasyCountriesList from 'easy-countries-list';

const countries = EasyCountriesList.getAllCountries();

Return object:

[
  {...},
  {
    name: 'United States',
    countryCode: 'US' // ISO alpha-2
  },
  {...}
]
  • Filter by Country Name:

import EasyCountriesList from 'easy-countries-list';

const countries = EasyCountriesList.filterByCountryName('united states');

Return object:

{
  name: 'United States',
  countryCode: 'US', // ISO alpha-2
  countryCodeThree: 'USA' // ISO alpha-3
}
  • Filter by Country Code:

import EasyCountriesList from 'easy-countries-list';

const countries = EasyCountriesList.filterByCountryCode('Us');

Return object:

{
  name: 'United States',
  countryCode: 'US', // ISO alpha-2
  countryCodeThree: 'USA' // ISO alpha-3
}
  • Filter by Country Code Three:

import EasyCountriesList from 'easy-countries-list';

const countries = EasyCountriesList.filterByCountryCodeThree('Usa');

Return object:

{
  name: 'United States',
  countryCode: 'US', // ISO alpha-2
  countryCodeThree: 'USA' // ISO alpha-3
}

Next Feature

  • Add states list for US and Canada.

Keywords

easy

FAQs

Package last updated on 18 Apr 2016

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.