Socket
Book a DemoInstallSign in
Socket

@ottatech/locations

Package Overview
Dependencies
Maintainers
16
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ottatech/locations

Region and subregion information

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
16
Created
Source

@ottatech/locations

Location information shared across otta apps.

Provides:

  • regions: a map of ISO-3166 alpha-2 codes and their English language names
  • subregions: a map of ISO-3166 alpha-2 code to a map of CLDR subregions and their English language names.

Reference:

  • https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
  • https://unicode-org.github.io/cldr-staging/charts/latest/subdivisionNames/germanic.html

Usage

import { regions, subregions } from "@ottatech/locations";

const user = { region: 'US', subregion: 'USTX' };

const countryLabel = regions[user.region]; // United States
const subregionLabel = subregions[user.region][user.subregion]; // Texas

Keywords

locations

FAQs

Package last updated on 31 Aug 2022

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