Skip to content

chancejs/chance-iso3166

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chance-iso3166

Chance.js mixin to generate ISO-3166 country codes

Install

npm install -S chance chance-iso3166

Usage

// initialize chance instance
const chance = require('chance').Chance();

// add this module as mixin
chance.mixin({
  iso3166: require('chance-iso3166')
});

// profit
chance.iso3166();
/*
{
  name: 'Georgia',
  alpha2: 'GE',
  alpha3: 'GEO',
  numeric: '268'
}
*/

Reference

ISO 3166-1 - Wikiwand
ISO 3166-2 - Wikiwand

lukes/ISO-3166-Countries-with-Regional-Codes (all.json is pulled from here)
datasets/country-codes
mledoze/countries

About

Chance.js mixin to generate ISO-3166 country codes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published