Socket
Socket
Sign inDemoInstall

countrydb

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    countrydb

Country and region codes DB for node.js


Version published
Weekly downloads
2
Maintainers
1
Install size
185 kB
Created
Weekly downloads
 

Readme

Source

CountryDB

Country and region codes DB for node.js.

Usage

// JSON database is always stored in `countrydb.db` and it's
// at the moment the only provided member of `countrydb`.
var db = require("countrydb").db;

// DB maps two-letter country codes to an object having name
// and regions. The following will list all country codes and
// their names.
for (var k in db) {
  console.log("COUNTRY: '" + k + "' " + db[k].name);
}

// The following code lists all states in USA.
var regions = db.US.regions;
for (var k in regions) {
  console.log("STATE: '" + k + "' " + regions[k].name);
}

Keywords

FAQs

Last updated on 12 Mar 2015

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