Socket
Socket
Sign inDemoInstall

localized-countries

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    localized-countries

Country code to name mappings for several languages


Version published
Weekly downloads
4.9K
decreased by-16.8%
Maintainers
1
Install size
4.66 MB
Created
Weekly downloads
 

Readme

Source

localized-countries

FOSSA Status

Get a language by code
var german = require('localized-countries')('de')
german.get('CH') // returns 'Schweiz'

var english = require('localized-countries')('en')
english.get('CH') // returns 'Switzerland'

var japanese = require('localized-countries')('ja')
japanese.get('CH') // returns '\u30b9\u30a4\u30b9'
Get a countries array
var english = require('localized-countries')('en')
english.array()
// returns all countries as array [{code: "US", label: "United States"}, ....]
Get a countries map
var english = require('localized-countries')('en')
english.object()
// returns all countries as object {"US": "United States", "CH": "Switzerland"}
In the browser

You probably don't want to load all languages. So I suggest you to load specific files.

var englishCountries = require('localized-countries')(require('localized-countries/data/en'))
englishCountries.get('US') // returns 'United States'

License

FOSSA Status

Keywords

FAQs

Last updated on 31 Dec 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc