Skip to content

Releases: Clifftech123/CountryData.js

v2.0.0

Choose a tag to compare

@github-actions github-actions released this 22 Mar 11:48
90097a5

Major Changes

  • 22cd3be: Add states/provinces (4963), cities (148k+), timezones, and regions support. New functional module API — Country, State, City, Region, Timezone — with O(1) Map-based lookups. Enriched country data with currency code, coordinates, timezones, and flag emoji. Lazy loading for city data, pre-sorted JSON files, and full TypeScript types for all interfaces.

    Breaking Changes

    What changed

    • IRegion fields renamed from Name/ShortCode to name/shortCode (lowercase)
    • Data files moved from src/*.json to data/*.json

    Why

    Standardised all interfaces to use consistent lowercase field names matching the rest of the data model.

    How to update

    Before (v1.x):

    import { CountryHelper } from 'countrydata.js';
    const helper = new CountryHelper();
    const regions = helper.getRegionsByCountryShortCode('US');
    regions[0].Name; // old
    regions[0].ShortCode; // old

    After (v2.x):

    import {
      CountryHelper,
      Country,
      State,
      City,
      Region,
      Timezone,
    } from 'countrydata.js';
    
    // Class API (still works)
    const helper = new CountryHelper();
    const regions = helper.getRegionsByCountryShortCode('US');
    regions[0].name; // updated
    regions[0].shortCode; // updated
    
    // New module API
    const us = Country.getCountryByCode('US');
    const states = State.getStatesOfCountry('US');
    const cities = City.getCitiesOfState('US', 'CA');
    const tzs = Timezone.getTimezonesByCountryCode('US');

v1.1.0

Choose a tag to compare

@github-actions github-actions released this 15 Mar 14:51
934fd66

Minor Changes

  • 1f397b6: Enhanced the flag emoji functionality by renaming the method from getCountryEmoji to getCountryFlag, implementing proper string manipulation techniques, and optimizing performance.

v1.0.6

Choose a tag to compare

@github-actions github-actions released this 27 Sep 03:00
9b4cdb6

Patch Changes

  • 47916f4: Fix: Resolved the GitHub repository connection problem with npm and added a sample index.js.

v1.0.5

Choose a tag to compare

@github-actions github-actions released this 27 Sep 02:48
ed6c945

Patch Changes

  • 227b2df: Fix: Fixed TypeScript types for Country and Region. Fixed the TypeScript compilation error.
  • 3683b6d: Stable release for general use. Fixed all TypeScript issues and ensured compatibility with both JavaScript and TypeScript environments. Updated README to align with npm standards.
  • 83710eb: Updated build configuration to exclusively use ES Modules (ESM). Fixed the error our data.json not found. Updated the package.json to include the type field set to module.
  • 10f9d39: Fix: Fixed TypeScript types for Country and Region. Fixed the TypeScript compilation error.

v1.0.4

Choose a tag to compare

@github-actions github-actions released this 27 Sep 00:23
04ff9bf

Patch Changes

  • 10f9d39: Fix: Fixed TypeScript types for Country and Region. Fixed the TypeScript compilation error.

v1.0.3

Choose a tag to compare

@github-actions github-actions released this 26 Sep 23:07
6fa82a8

Patch Changes

  • 83710eb: Updated build configuration to exclusively use ES Modules (ESM). Fixed the error our data.json not found. Updated the package.json to include the type field set to module.

v1.0.2

Choose a tag to compare

@github-actions github-actions released this 26 Sep 21:28
f0adccf

Patch Changes

  • def97ba: Updated the GitHub Actions workflow to use Vitest for running tests and collecting coverage. Installed the @vitest/coverage-v8 dependency to ensure coverage reports are generated correctly. Updated the vitest.config.ts to specify the v8 coverage provider.

v1.0.1

Choose a tag to compare

@github-actions github-actions released this 22 Sep 19:04
c5760c9

Patch Changes

  • 19a4fd5: Fix JavaScript and TypeScript compatibility issues

v1.0.0

Choose a tag to compare

@github-actions github-actions released this 22 Sep 13:10
41368f1

Major Changes

  • 071426c: Initial release of CountryData.js. This package provides comprehensive country data for Node.js developers, allowing easy integration with any Node.js framework. It includes features such as retrieving country information by code and listing all countries.