Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including country-mapper with all npm packages installed. Try it out:

var countryMapper = require("country-mapper")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

country-mapper v1.2.1

Map from custom names to ISO 3166


Build Status

Country naming approach might be very unique from org to org. The reason for that is that decision makers do not pay much attention to existing industry standards while just stop on the nice looking names, which will lead to errors when different systems should talk to each other. We notice that country should have aligned with ISO 3166 name. To not have you to change your way, we offer you to introduce a country mapping as below:

Sint Eustatius -> Bonaire, Saint Eustatius And Saba
Bonaire -> Bonaire, Saint Eustatius And Saba


Via npm:

npm install country-mapper


  var mapper = require('county-mapper');
  mapper.convert('Russian Federation'); // RU
  mapper.convert('Russia'); // RU
  var mapper = require('county-mapper');
  mapper.iso('Russia'); // Russian Federation


Formidable is licensed under the MIT license.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free