Open sourceEasy

countries-mania-js

Published npm package offering a fluent API for normalising and aggregating country data across ISO codes, nationalities and custom metadata.

— Overview

Architecture Overview

graph LR
    A["countries.build()"] --> B[Builder chain]
    B --> C[".withCurrency()"]
    B --> D[".withPopulation()"]
    B --> E[".withCapitalCity()"]
    B --> F[".withCallingCode()"]
    C & D & E & F --> G[Normaliser]
    H[i18n-iso-countries] --> G
    I[i18n-nationality] --> G
    G --> J["build() / toJSON() / toFile()"]

A small library that turns scattered country reference data into one consistent shape. Rather than exposing a fixed record, it offers a builder: you chain on only the fields you care about, then materialise the result as an object, a JSON string or a file on disk.

It sits on top of i18n-iso-countries and i18n-nationality, reconciling their differing key sets and filling in the extra metadata — currency, population, capital city, calling code — that neither package provides on its own.

Key Features:

  • Fluent, chainable builder API with opt-in enrichment
  • ISO 3166 codes and nationality names reconciled into a single record
  • Optional currency, population, capital city and calling-code metadata
  • Three output modes: in-memory object, JSON string, or written file
  • Published to npm under the MIT licence
  • Zero configuration beyond the two peer data packages

Tech Stack:

  • Language: JavaScript, Node.js
  • Distribution: npm
  • Data sources: i18n-iso-countries, i18n-nationality
— Stack
JavaScriptNode.jsnpm