pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/ZECTBynmo/countrycode

link crossorigen="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-b69241e157469407.css" /> GitHub - ZECTBynmo/countrycode: npm module to associate country codes with country names · GitHub
Skip to content

ZECTBynmo/countrycode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

This module allows you to find a country's name from its country code, and a country's code from its name.

Installation

npm install countrycode

Usage

var countryCode = require("countrycode");

var myCountry = "Albania";

var myCountrySearch = "alb";

var myCodeSearch = 93;

var myCountrysCode = countryCode.getCode(myCountry);
console.log(myCountrysCode); // Prints 213

var verifyCountryName = countryCode.getCountry(myCountriesCode);
console.log(verifyCountryName);	// Prints "Albania"

var findCountriesLike = countryCode.searchCountry(myCountrySearch);

// Prints [ { country: 'Albania', code: 213 }, { country: 'Svalbard', code: 0 } ]
console.log(findCountriesLike);

var findCodesLike = countryCode.searchCode(myCodeSearch);

// Prints [ { country: 'Afghanistan', code: 93 }, { country: 'Ecuador', code: 593 }, 
//          { country: 'Turkmenistan', code: 993 } ]
console.log(findCodesLike);

Note: Country names are NOT case sensitive

About

npm module to associate country codes with country names

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy