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

@brixtol/country-continent

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@brixtol/country-continent

Mappings for 2 letter (Alpha 2) country codes to Continent code/name

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
192
decreased by-21.63%
Maintainers
1
Weekly downloads
 
Created
Source

@brixtol/country-continent

Country code (3166-1 alpha-2) to Continent code/name mappings used by the Brixtol Textiles internal API when dealing with Localization and i18n operations.

Mappings returned in the English Language.

Minified: 2.39 KB
Gzipped: 897 B

Install

pnpm

pnpm add @brixtol/country-continent

npm

npm install @brixtol/country-continent

Yarn

yarn add @brixtol/country-continent

Usage

You can pass in a 2 letter country code that is lowercase, uppercase or a mixture of both.

import { getContinentCode, getContinentName } from '@brixtol/country-continent';

const sweden = getContinentName('SE'); // Europe
const russia = getContinentName('ru'); // Asia
const usa = getContinentName('uS'); // North America
const australia = getContinentCode('AU'); // OC
EXTRAS

The module also exposes the raw mappings and interface on the export. The mappings object is provided read only using Object.freeze. In addition to the raw mappings a ISO code union export is also exposed.

import { IContinents, ContinentCodes, ContinentNames } from '@brixtol/country-continent';

// Mapping Object

ContinentCodes.SE; // EU
ContinentNames.SE; // Europe
ContinentCodes.NL; // EU
ContinentNames.NL; // Europe
ContinentCodes.RU; // AS
ContinentNames.RU; // Asia

// Interface

IContinents.SE; // EU
IContinents.NL; // EU
IContinents.RU; // AS

The interface is identical to the mapping

Static GeoIP utility

Country code to currency code mappings:

Currency code to currency symbol mappings:

License

Licensed under MIT


We open source!

Keywords

FAQs

Package last updated on 01 Dec 2021

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