Socket
Book a DemoInstallSign in
Socket

@legendaryrob/countrify

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@legendaryrob/countrify

A package to assist in the disection of ISO-3166-1(country) and ISO-3166-2(subdivision) ISO standards.

2.1.1
latest
Source
npmnpm
Version published
Weekly downloads
67
-42.24%
Maintainers
1
Weekly downloads
 
Created
Source

@legendaryrob/countrify

npm (scoped) npm bundle size (minified)

Install

$ npm install @legendaryrob/countrify

Usage

const countrify = require("@legendaryrob/countrify")

// Finding names

countrify.getName("USD");
//=> "United States of America"

countrify.getName("US");
//=> "United States of America"


// Getting Alpha3 codes

countrify.getAlpha3("South Africa");
//=> "SAF"

countrify.getAlpha3("SA");
//=> "SAF"

// Getting Alpha2 codes

countrify.getAlpha3("South Africa");
//=> "SA"

countrify.getAlpha3("SAF");
//=> "SA"

// Getting a list of all the countries

countrify.allCountriesList();
//=> ['Andorra', 'United Arab Emirates', 'Afghanistan'...]

// Getting a list of all the subdivisions for country

countrify.getSubdivisionsList('South Africa', 'en');
//=> ['Eastern Cape', 'Free State', 'Gauteng'...]

// are able to swap out the country name with alpha2/alpha3
countrify.getSubdivisionsList('SAF', 'en');
//=> ['Eastern Cape', 'Free State', 'Gauteng'...]

// are able to swap out the country name with alpha2/alpha3
countrify.getSubdivisionsList('SAF', 'fr');
//=> ['Cap oriental', 'État-Libre', 'Gauteng'...]

Keywords

ISO-3166-1

FAQs

Package last updated on 15 May 2019

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.