How to use the countries-list.countries function in countries-list

To help you get started, we’ve selected a few countries-list examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github liferay / alloy-editor / plugins / gatsby-remark-foreach-icons / index.js View on Github external
const visit = require('unist-util-visit');
const {resolve} = require('path');
const countries = require('countries-list').countries;
const globby = require('globby');
const langs = require('languages');

const alternateCodes = {
	in: 'id',
	iw: 'he',
	nb: 'no',
};

function replaceValue(array) {
	const htmlValue = array.map(
		item =&gt; `<li>
        <svg class="lexicon-icon lexicon-icon-${item.icon}">
            
        </svg>
        <span>${item.name}</span></li>
github diegonvs / gatsby-boilerplate / plugins / gatsby-remark-foreach-icons / index.js View on Github external
const visit = require('unist-util-visit');
const {resolve} = require('path');
const countries = require('countries-list').countries;
const globby = require('globby');
const langs = require('languages');
const { pathPrefix } = require('../../gatsby-config');

const alternateCodes = {
	'in': 'id',
	'iw': 'he',
	'nb': 'no',
};

function replaceValue(array) {
	const htmlValue = array.map(item =&gt; `<li>
        <svg class="lexicon-icon lexicon-icon-${item.icon}">
            
        </svg>
        <span>${item.name}</span></li>
github CoderDojo / cp-dojos-service / dojos.js View on Github external
function calculateContinent (alpha2) {
      return countriesList.countries && countriesList.countries[alpha2] ? countriesList.countries[alpha2].continent : null;
    }
github mrvautin / expressCart / lib / common.js View on Github external
const getCountryList = () => {
    const countryArray = [];
    Object.keys(countryList.countries).forEach((country) => {
        countryArray.push(countryList.countries[country].name);
    });
    return countryArray;
};
github CoderDojo / cp-dojos-service / dojos.js View on Github external
function calculateContinent (alpha2) {
      return countriesList.countries[alpha2].continent;
    }
github mrvautin / expressCart / lib / common.js View on Github external
Object.keys(countryList.countries).forEach((country) => {
        countryArray.push(countryList.countries[country].name);
    });
    return countryArray;

countries-list

Continents & countries: ISO 3166-1 alpha-2 code, name, ISO 639-1 languages, capital, currency, native name, phone. JSON, CSV and SQL.

MIT
Latest version published 4 months ago

Package Health Score

77 / 100
Full package analysis

Popular countries-list functions