Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

node-country-list

1.0.2 • Public • Published

node-country-list

translate country Alpha-2 code to country name in 100+ languages

setup

npm install node-country-list

example

const Countries = require('node-country-list');
 
// Countries.get(alpha2Code: string, langCode: string): string
Countries.get('us', 'de'); // Vereinigte Staaten
Countries.get('FR', 'ZH'); // 法国
Countries.get('something', 'unknown'); // undefined

please note

  • library is using lazy loading for language data to safe on startup and overall memory footprint
  • it is nodejs library - fs and path are required

supported language codes

  • af
  • ak
  • am
  • ar
  • as
  • az
  • be
  • bg
  • bm
  • bn
  • bo
  • br
  • bs
  • ca
  • ce
  • cs
  • cy
  • da
  • de
  • dz
  • ee
  • el
  • en
  • eo
  • es
  • et
  • eu
  • fa
  • ff
  • fi
  • fo
  • fr
  • fy
  • ga
  • gd
  • gl
  • gu
  • gv
  • ha
  • he
  • hi
  • hr
  • hu
  • hy
  • id
  • ig
  • ii
  • is
  • it
  • ja
  • ka
  • ki
  • kk
  • kl
  • km
  • kn
  • ko
  • ks
  • kw
  • ky
  • lb
  • lg
  • ln
  • lo
  • lt
  • lu
  • lv
  • mg
  • mk
  • ml
  • mn
  • mr
  • ms
  • mt
  • my
  • nb
  • nd
  • ne
  • nl
  • nn
  • no
  • om
  • or
  • os
  • pa
  • pl
  • ps
  • pt
  • qu
  • rm
  • rn
  • ro
  • ru
  • rw
  • se
  • sg
  • sh
  • si
  • sk
  • sl
  • sn
  • so
  • sq
  • sr
  • sv
  • sw
  • ta
  • te
  • th
  • ti
  • tl
  • to
  • tr
  • ug
  • uk
  • ur
  • uz
  • vi
  • yi
  • yo
  • zh
  • zu

sources

install

npm i node-country-list

Downloadsweekly downloads

114

version

1.0.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability