{"id":15015966,"url":"https://github.com/mnowik/ember-countries","last_synced_at":"2025-04-12T09:31:15.662Z","repository":{"id":49019909,"uuid":"53220249","full_name":"mnowik/ember-countries","owner":"mnowik","description":"Ember addon that provide list of countries","archived":false,"fork":false,"pushed_at":"2021-06-30T23:12:55.000Z","size":46,"stargazers_count":11,"open_issues_count":9,"forks_count":24,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-26T15:22:40.218Z","etag":null,"topics":["ember","ember-addon","ember-cli-addon","npm"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mnowik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-05T19:51:59.000Z","updated_at":"2022-01-16T12:54:25.000Z","dependencies_parsed_at":"2022-09-01T14:02:56.681Z","dependency_job_id":null,"html_url":"https://github.com/mnowik/ember-countries","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnowik%2Fember-countries","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnowik%2Fember-countries/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnowik%2Fember-countries/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnowik%2Fember-countries/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mnowik","download_url":"https://codeload.github.com/mnowik/ember-countries/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223510333,"owners_count":17157306,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ember","ember-addon","ember-cli-addon","npm"],"created_at":"2024-09-24T19:48:13.335Z","updated_at":"2024-11-07T12:03:40.352Z","avatar_url":"https://github.com/mnowik.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ember-countries\n[![npm version](https://badge.fury.io/js/ember-countries.svg)](https://badge.fury.io/js/ember-countries)\n[![Ember Observer Score](http://emberobserver.com/badges/ember-countries.svg)](http://emberobserver.com/addons/ember-countries)\n\nA simple Addon that contains the 6 following lists:\n - all the countries in ISO2 (US), ISO3 (USA), ISO-Numeric (840) and English name (United States) formats.\n - the countries without ZIP Code.\n - the countries with states.\n - the US states \u0026 military states\n - the US states that require customs declaration\n - the Canadian states\n\nHere are a list of the main helpers:\n - Country ISO2, ISO3 or ISO-Numeric to Country object.\n - Is country with state.\n - Is country without ZIP Code.\n - State ISO2 to State object\n\nYou can find more information about ISO codes here:\n - [ISO 3166-1 standard](https://en.wikipedia.org/wiki/ISO_3166-1)\n - [ISO 3166-2 standard](https://en.wikipedia.org/wiki/ISO_3166-2)\n\n## Installation\n\n* `ember install ember-countries`\n\n\n## Upgrading from 1.x.x to 2.0.0\n\nHere are all the information that you need to migrate from version 1.x.x to 2.0.0: [Migrating from 1.x.x to 2.0.0](https://github.com/mnowik/ember-countries/wiki/Migrating-from-1.x.x-to-2.0.0)\n\n## Usage\n\n### All imports\n```js\nimport { COUNTRIES_LIST, COUNTRIES_WITHOUT_ZIP_LIST, COUNTRIES_WITH_STATES_LIST } from 'ember-countries';\nimport { US_STATES_LIST, US_MILITARY_STATES_LIST, US_REQUIRING_CUSTOM_DECLARATION_STATES_LIST, CA_STATES_LIST, STATES_BY_COUNTRIES } from 'ember-countries';\nimport { getCountry, isCountryWithState, isCountryWithoutZip } from 'ember-countries';\nimport { getStatesForCountry, isCustomsDeclarationRequiredInUS, countryContainsState, getState } from 'ember-countries';\nimport defaultEmberCountries from 'ember-countries';\n```\n\n### Example 1: countries lists\n```js\nimport Em from 'ember';\nimport { COUNTRIES_LIST } from 'ember-countries';\n\nexport default Em.Controller.extend({\n\n  COUNTRIES_LIST: COUNTRIES_LIST,\n  ...\n});\n```\n\n### Example 2: countries properties\n```js\nimport Em from 'ember';\nimport { getCountry, isCountryWithState, isCountryWithoutZip } from 'ember-countries';\n\nexport default Em.Controller.extend({\n\n  countryHelper() {\n    let expect   = {name: \"United States\", iso2: \"US\", iso3: \"USA\", isoNumeric: \"840\"}\n    let country1 = getCountry('US');\n    let country2 = getCountry('USA');\n    let country3 = getCountry('840');\n    \n    country1 === expect  // true\n    country2 === expect  // true\n    country3 === expect  // true\n    \n    isCountryWithState('US')  // true\n    isCountryWithoutZip('US')  // false\n  },\n  ...\n});\n```\n\n### Example 3: states lists\n```js\nimport Em from 'ember';\nimport emberCountries from 'ember-countries';\n\nexport default Em.Controller.extend({\n\n  US_STATES: emberCountries.US_STATES_LIST,\n  ...\n});\n```\n\n### Example 4: states properties\n```js\nimport Em from 'ember';\nimport { getState, countryContainsState } from 'ember-countries';\n\nexport default Em.Controller.extend({\n\n  countryHelper() {\n    let expect = {name: \"California\", iso2: \"CA\"}\n    let state1 = getState('US', 'CA');\n    let state2 = getState('USA', 'CA');\n    let state3 = getState('840', 'CA');\n    \n    state1 === expect  // true\n    state2 === expect  // true\n    state3 === expect  // true\n    \n    countryContainsState('US', 'CA')  // true\n  },\n  ...\n});\n```\n## Running Tests\n\n* `npm test` (Runs `ember try:each` to test your addon against multiple Ember versions)\n* `ember test`\n* `ember test --server`\n\n\n## Building\n\n* `ember build`\n\nFor more information on using ember-cli, visit [http://ember-cli.com/](http://ember-cli.com/).\n\n## Contributing\n\nPRs welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnowik%2Fember-countries","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmnowik%2Fember-countries","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnowik%2Fember-countries/lists"}