Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

iso-3166-2

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iso-3166-2

Lookup information about ISO-3166-2 subdivisions.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is iso-3166-2?

The iso-3166-2 npm package provides utilities for working with ISO 3166-2 codes, which are used to define the principal subdivisions (e.g., provinces or states) of all countries coded in ISO 3166-1.

What are iso-3166-2's main functionalities?

Get country subdivisions

This feature allows you to retrieve the subdivisions of a given country using its ISO 3166-1 alpha-2 code. In this example, it retrieves the subdivisions of the United States.

const iso3166 = require('iso-3166-2');
const subdivisions = iso3166.subdivision('US');
console.log(subdivisions);

Get subdivision name

This feature allows you to get the name of a specific subdivision by providing the country code and the subdivision code. In this example, it retrieves the name of the subdivision 'CA' in the United States.

const iso3166 = require('iso-3166-2');
const subdivisionName = iso3166.subdivision('US', 'CA');
console.log(subdivisionName);

Get country name

This feature allows you to get the name of a country by providing its ISO 3166-1 alpha-2 code. In this example, it retrieves the name of the country 'US'.

const iso3166 = require('iso-3166-2');
const countryName = iso3166.country('US');
console.log(countryName);

Other packages similar to iso-3166-2

Keywords

FAQs

Package last updated on 20 Aug 2017

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc