country-region
v0.0.6
Published
get country region via country name
Downloads
12
Readme
country-region
Get Region Name With Country
Get the Region of any country By Passing CountryName
const countryName = require('country-region');
countryName('India');
/*
{ countryName: 'India',
countryShortCode: 'IN',
regions:
[ { name: 'Andaman and Nicobar Islands', shortCode: 'AN' },
{ name: 'Andhra Pradesh', shortCode: 'AP' },
{ name: 'Arunachal Pradesh', shortCode: 'AR' },
{ name: 'Assam', shortCode: 'AS' },
{ name: 'Bihar', shortCode: 'BR' },
{ name: 'Chandigarh', shortCode: 'CH' },
{ name: 'Chhattisgarh', shortCode: 'CT' },
{ name: 'Dadra and Nagar Haveli', shortCode: 'DN' },
{ name: 'Daman and Diu', shortCode: 'DD' },
{ name: 'Delhi', shortCode: 'DL' },
{ name: 'Goa', shortCode: 'GA' },
{ name: 'Gujarat', shortCode: 'GJ' },
{ name: 'Haryana', shortCode: 'HR' },
{ name: 'Himachal Pradesh', shortCode: 'HP' },
{ name: 'Jammu and Kashmir', shortCode: 'JK' },
{ name: 'Jharkhand', shortCode: 'JH' },
{ name: 'Karnataka', shortCode: 'KA' },
{ name: 'Kerala', shortCode: 'KL' },
{ name: 'Lakshadweep', shortCode: 'LD' },
{ name: 'Madhya Pradesh', shortCode: 'MP' },
{ name: 'Maharashtra', shortCode: 'MH' },
{ name: 'Manipur', shortCode: 'MN' },
{ name: 'Meghalaya', shortCode: 'ML' },
{ name: 'Mizoram', shortCode: 'MZ' },
{ name: 'Nagaland', shortCode: 'NL' },
{ name: 'Odisha', shortCode: 'OR' },
{ name: 'Puducherry', shortCode: 'PY' },
{ name: 'Punjab', shortCode: 'PB' },
{ name: 'Rajasthan', shortCode: 'RJ' },
{ name: 'Sikkim', shortCode: 'WK' },
{ name: 'Tamil Nadu', shortCode: 'TN' },
{ name: 'Telangana', shortCode: 'TG' },
{ name: 'Tripura', shortCode: 'TR' },
{ name: 'Uttarakhand', shortCode: 'UT' },
{ name: 'Uttar Pradesh', shortCode: 'UP' },
{ name: 'West Bengal', shortCode: 'WB' } ] }
*/
import countryName from 'country-region';
countryName('India');
/*
{ countryName: 'India',
countryShortCode: 'IN',
regions:
[ { name: 'Andaman and Nicobar Islands', shortCode: 'AN' },
{ name: 'Andhra Pradesh', shortCode: 'AP' },
{ name: 'Arunachal Pradesh', shortCode: 'AR' },
{ name: 'Assam', shortCode: 'AS' },
{ name: 'Bihar', shortCode: 'BR' },
{ name: 'Chandigarh', shortCode: 'CH' },
{ name: 'Chhattisgarh', shortCode: 'CT' },
{ name: 'Dadra and Nagar Haveli', shortCode: 'DN' },
{ name: 'Daman and Diu', shortCode: 'DD' },
{ name: 'Delhi', shortCode: 'DL' },
{ name: 'Goa', shortCode: 'GA' },
{ name: 'Gujarat', shortCode: 'GJ' },
{ name: 'Haryana', shortCode: 'HR' },
{ name: 'Himachal Pradesh', shortCode: 'HP' },
{ name: 'Jammu and Kashmir', shortCode: 'JK' },
{ name: 'Jharkhand', shortCode: 'JH' },
{ name: 'Karnataka', shortCode: 'KA' },
{ name: 'Kerala', shortCode: 'KL' },
{ name: 'Lakshadweep', shortCode: 'LD' },
{ name: 'Madhya Pradesh', shortCode: 'MP' },
{ name: 'Maharashtra', shortCode: 'MH' },
{ name: 'Manipur', shortCode: 'MN' },
{ name: 'Meghalaya', shortCode: 'ML' },
{ name: 'Mizoram', shortCode: 'MZ' },
{ name: 'Nagaland', shortCode: 'NL' },
{ name: 'Odisha', shortCode: 'OR' },
{ name: 'Puducherry', shortCode: 'PY' },
{ name: 'Punjab', shortCode: 'PB' },
{ name: 'Rajasthan', shortCode: 'RJ' },
{ name: 'Sikkim', shortCode: 'WK' },
{ name: 'Tamil Nadu', shortCode: 'TN' },
{ name: 'Telangana', shortCode: 'TG' },
{ name: 'Tripura', shortCode: 'TR' },
{ name: 'Uttarakhand', shortCode: 'UT' },
{ name: 'Uttar Pradesh', shortCode: 'UP' },
{ name: 'West Bengal', shortCode: 'WB' } ] }
*/