{"_id":"@augustdev/ccs-fc","_rev":"3-564a38391f25c2e104a35653738fe212","name":"@augustdev/ccs-fc","dist-tags":{"latest":"4.1.1"},"versions":{"4.0.0":{"name":"@augustdev/ccs-fc","version":"4.0.0","keywords":["Country","State","City","GeoLocation","Search","Filter"],"author":{"name":"faugustdev"},"license":"GPL-3.0","_id":"@augustdev/ccs-fc@4.0.0","maintainers":[{"name":"augustdev","email":"francisco.august.fa@gmail.com"}],"homepage":"https://github.com/faugustdev/ccs-fc#readme","bugs":{"url":"https://github.com/faugustdev/ccs-fc/issues"},"dist":{"shasum":"ca0b176ad99ca31745427ce7703f0331143eca85","tarball":"https://registry.npmjs.org/@augustdev/ccs-fc/-/ccs-fc-4.0.0.tgz","fileCount":37,"integrity":"sha512-tF9f+yaU4K2Hauh6oQe2iGXSD17faftKF4qY8BmZpj3TQ/FMifSuqqYqfFM5QogyRcxSXazw40VSF9OlbVn6ow==","signatures":[{"sig":"MEQCIB5GLn+cBY3RmxuZSVy81W1ieGgcGfdvaLN/mbngDafkAiBJ4RjVpe+V0zhjID6GSTqSgbYLbSmZ+3Hxi9+szqd9NA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17739488},"jest":{"moduleDirectories":["node_modules","bower_components","src"],"moduleFileExtensions":["js","jsx"]},"main":"./lib/cjs/index.js","husky":{"hooks":{"pre-push":"npm test","pre-commit":"npm test"}},"types":"./lib/index.d.ts","module":"./lib/index.js","exports":{".":{"types":"./lib/index.d.ts","import":"./lib/index.js","require":"./lib/cjs/index.js"},"./city":{"types":"./lib/city.d.ts","import":"./lib/city.js","require":"./lib/cjs/city.js"},"./state":{"types":"./lib/state.d.ts","import":"./lib/state.js","require":"./lib/cjs/state.js"},"./country":{"types":"./lib/country.d.ts","import":"./lib/country.js","require":"./lib/cjs/country.js"}},"gitHead":"5e21d9ab4d1ba1912bfd67a82837db24cc0eb629","scripts":{"lint":"eslint index.ts __test__ --fix","test":"jest","build":"npm run build-index && tsc -p tsconfig.json && tsc -p tsconfig-cjs.json && npm run minify","minify":"ts-node src/scripts/minify.ts","prepublish":"npm run build","split-data":"ts-node src/scripts/splitLargeDatasetFiles-CSC.ts","build-index":"ts-node src/scripts/buildIndex.ts","update-data":"ts-node src/scripts/combineSplitFilesToMakeALargeDatasetFiles-CSC.ts","update-data-with-gz":"gz=true ts-node src/scripts/combineSplitFilesToMakeALargeDatasetFiles-CSC.ts"},"_npmUser":{"name":"augustdev","email":"francisco.august.fa@gmail.com"},"repository":{"url":"git+https://github.com/faugustdev/ccs-fc.git","type":"git"},"_npmVersion":"11.8.0","description":"Optimized fork of country-state-city. Indexed lookups and tree-shakeable subpath exports for countries, states, and cities.","directories":{"lib":"lib"},"sideEffects":false,"_nodeVersion":"25.6.0","_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","husky":"^4.3.8","eslint":"^7.32.0","ts-jest":"^26.5.6","ts-node":"^10.9.1","prettier":"^2.8.3","ts-loader":"^9.4.2","typescript":"^4.9.4","@types/jest":"^26.0.24","@types/node":"^16.18.11","eslint-config-airbnb":"^18.2.1","eslint-plugin-import":"^2.27.5","eslint-config-prettier":"^7.2.0","eslint-plugin-prettier":"^3.4.1","@typescript-eslint/parser":"^4.33.0","@typescript-eslint/eslint-plugin":"^4.33.0"},"_npmOperationalInternal":{"tmp":"tmp/ccs-fc_4.0.0_1770998385354_0.2773531585233959","host":"s3://npm-registry-packages-npm-production"}},"4.1.0":{"name":"@augustdev/ccs-fc","version":"4.1.0","keywords":["Country","State","City","GeoLocation","Search","Filter"],"author":{"name":"faugustdev"},"license":"GPL-3.0","_id":"@augustdev/ccs-fc@4.1.0","maintainers":[{"name":"augustdev","email":"francisco.august.fa@gmail.com"}],"homepage":"https://github.com/faugustdev/ccs-fc#readme","bugs":{"url":"https://github.com/faugustdev/ccs-fc/issues"},"dist":{"shasum":"578ec84e6ce0bf020abd9dae3afbedd1154bd44d","tarball":"https://registry.npmjs.org/@augustdev/ccs-fc/-/ccs-fc-4.1.0.tgz","fileCount":419,"integrity":"sha512-qkqqBDVLzrXxatWc9+CeOtTje0x6kLlhFwzrg5KsikgL6KOa8wdB8xuxIyYqOJFBv3Qm1NKPW/8/o5Mp9e4Huw==","signatures":[{"sig":"MEQCIFmiGFs7eqBKcsfAS87iF7V1xHvhGD0JnLFz+KlT+r2sAiAonpyxTCc/Pz5+mHfHipvlt6gCFCO5s8uyjIe5rAAdyw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11446598},"jest":{"moduleDirectories":["node_modules","bower_components","src"],"moduleFileExtensions":["js","jsx"]},"main":"./lib/cjs/index.js","husky":{"hooks":{"pre-push":"npm test","pre-commit":"npm test"}},"types":"./lib/index.d.ts","module":"./lib/index.js","exports":{".":{"types":"./lib/index.d.ts","import":"./lib/index.js","require":"./lib/cjs/index.js"},"./city":{"types":"./lib/city.d.ts","import":"./lib/city.js","require":"./lib/cjs/city.js"},"./state":{"types":"./lib/state.d.ts","import":"./lib/state.js","require":"./lib/cjs/state.js"},"./country":{"types":"./lib/country.d.ts","import":"./lib/country.js","require":"./lib/cjs/country.js"}},"gitHead":"65cb2b62b6d76124002dba83d83df3ecf28291b8","scripts":{"lint":"eslint index.ts __test__ --fix","test":"jest","build":"npm run build-index && tsc -p tsconfig.json && tsc -p tsconfig-cjs.json && npm run minify","minify":"ts-node src/scripts/minify.ts","pretest":"npm run build-index","prepublish":"npm run build","split-data":"ts-node src/scripts/splitLargeDatasetFiles-CSC.ts","build-index":"ts-node src/scripts/buildIndex.ts","update-data":"ts-node src/scripts/combineSplitFilesToMakeALargeDatasetFiles-CSC.ts","update-data-with-gz":"gz=true ts-node src/scripts/combineSplitFilesToMakeALargeDatasetFiles-CSC.ts"},"_npmUser":{"name":"augustdev","email":"francisco.august.fa@gmail.com"},"repository":{"url":"git+https://github.com/faugustdev/ccs-fc.git","type":"git"},"_npmVersion":"11.8.0","description":"Optimized fork of country-state-city. Indexed lookups and tree-shakeable subpath exports for countries, states, and cities.","directories":{"lib":"lib"},"sideEffects":false,"_nodeVersion":"25.6.0","_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","husky":"^4.3.8","eslint":"^7.32.0","ts-jest":"^26.5.6","ts-node":"^10.9.1","prettier":"^2.8.3","ts-loader":"^9.4.2","typescript":"^4.9.4","@types/jest":"^26.0.24","@types/node":"^16.18.11","eslint-config-airbnb":"^18.2.1","eslint-plugin-import":"^2.27.5","eslint-config-prettier":"^7.2.0","eslint-plugin-prettier":"^3.4.1","@typescript-eslint/parser":"^4.33.0","@typescript-eslint/eslint-plugin":"^4.33.0"},"_npmOperationalInternal":{"tmp":"tmp/ccs-fc_4.1.0_1771001379318_0.47222167349117283","host":"s3://npm-registry-packages-npm-production"}},"4.1.1":{"name":"@augustdev/ccs-fc","version":"4.1.1","description":"Optimized fork of country-state-city. Indexed lookups and tree-shakeable subpath exports for countries, states, and cities.","main":"./lib/cjs/index.js","module":"./lib/index.js","types":"./lib/index.d.ts","exports":{".":{"import":"./lib/index.js","require":"./lib/cjs/index.js","types":"./lib/index.d.ts"},"./country":{"import":"./lib/country.js","require":"./lib/cjs/country.js","types":"./lib/country.d.ts"},"./state":{"import":"./lib/state.js","require":"./lib/cjs/state.js","types":"./lib/state.d.ts"},"./city":{"import":"./lib/city.js","require":"./lib/cjs/city.js","types":"./lib/city.d.ts"}},"sideEffects":false,"scripts":{"pretest":"npm run build-index","test":"jest","build-index":"ts-node src/scripts/buildIndex.ts","build":"npm run build-index && tsc -p tsconfig.json && tsc -p tsconfig-cjs.json && npm run minify","prepublish":"npm run build","lint":"eslint index.ts __test__ --fix","minify":"ts-node src/scripts/minify.ts","split-data":"ts-node src/scripts/splitLargeDatasetFiles-CSC.ts","update-data":"ts-node src/scripts/combineSplitFilesToMakeALargeDatasetFiles-CSC.ts","update-data-with-gz":"gz=true ts-node src/scripts/combineSplitFilesToMakeALargeDatasetFiles-CSC.ts"},"author":{"name":"faugustdev"},"license":"GPL-3.0","directories":{"lib":"lib"},"repository":{"type":"git","url":"git+https://github.com/faugustdev/ccs-fc.git"},"husky":{"hooks":{"pre-commit":"npm test","pre-push":"npm test"}},"keywords":["Country","State","City","GeoLocation","Search","Filter"],"bugs":{"url":"https://github.com/faugustdev/ccs-fc/issues"},"homepage":"https://github.com/faugustdev/ccs-fc#readme","devDependencies":{"@types/jest":"^26.0.24","@types/node":"^16.18.11","@typescript-eslint/eslint-plugin":"^4.33.0","@typescript-eslint/parser":"^4.33.0","eslint":"^7.32.0","eslint-config-airbnb":"^18.2.1","eslint-config-prettier":"^7.2.0","eslint-plugin-import":"^2.27.5","eslint-plugin-prettier":"^3.4.1","husky":"^4.3.8","jest":"^26.6.3","prettier":"^2.8.3","ts-jest":"^26.5.6","ts-loader":"^9.4.2","ts-node":"^10.9.1","typescript":"^4.9.4"},"jest":{"moduleFileExtensions":["js","jsx"],"moduleDirectories":["node_modules","bower_components","src"]},"gitHead":"f7ef2515fcd52f5bffa4e394deed493eea719bdd","_id":"@augustdev/ccs-fc@4.1.1","_nodeVersion":"25.6.0","_npmVersion":"11.8.0","dist":{"integrity":"sha512-KboZK5mb8WUfJttfSG6P1arxUr1mnx8vfE9jFAUHV/S4bZ8eEn7P5JNHhsSyzNJZ68Om0mdI1L9qdppBBLD+ag==","shasum":"d94ae11698946172a9ecd1eebfc179c5c1146fba","tarball":"https://registry.npmjs.org/@augustdev/ccs-fc/-/ccs-fc-4.1.1.tgz","fileCount":419,"unpackedSize":11446865,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHAWh/uRxI0oL2ZwRP1X9hpCiEiXFxSdqUlI1hq8b0KxAiEAjb5OqrccTDd8asBcISwf0YilwoQV9wtPSflIP+vqe6Q="}]},"_npmUser":{"name":"augustdev","email":"francisco.august.fa@gmail.com"},"maintainers":[{"name":"augustdev","email":"francisco.august.fa@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ccs-fc_4.1.1_1771003760785_0.14503287940133558"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-13T15:59:45.236Z","modified":"2026-02-13T17:29:21.263Z","4.0.0":"2026-02-13T15:59:45.852Z","4.1.0":"2026-02-13T16:49:39.642Z","4.1.1":"2026-02-13T17:29:21.128Z"},"bugs":{"url":"https://github.com/faugustdev/ccs-fc/issues"},"author":{"name":"faugustdev"},"license":"GPL-3.0","homepage":"https://github.com/faugustdev/ccs-fc#readme","keywords":["Country","State","City","GeoLocation","Search","Filter"],"repository":{"type":"git","url":"git+https://github.com/faugustdev/ccs-fc.git"},"description":"Optimized fork of country-state-city. Indexed lookups and tree-shakeable subpath exports for countries, states, and cities.","maintainers":[{"name":"augustdev","email":"francisco.august.fa@gmail.com"}],"readme":"# @augustdev/ccs-fc\n\n[![npm version](https://img.shields.io/npm/v/@augustdev/ccs-fc)](https://www.npmjs.com/package/@augustdev/ccs-fc)\n[![license](https://img.shields.io/npm/l/@augustdev/ccs-fc)](https://github.com/faugustdev/ccs-fc/blob/develop/LICENSE)\n\n**C**ountry **C**ities **S**tates - **F**ast **C**harged\n\nOptimized fork of [country-state-city](https://github.com/harpreetkhalsagtbit/country-state-city) for fetching Countries, States and Cities.\n\nData Source: [dr5hn/countries-states-cities-database](https://github.com/dr5hn/countries-states-cities-database)\n\n## Why this fork?\n\n| Problem | Original | This fork |\n|---------|----------|-----------|\n| **Bundle size** | Importing `Country` alone pulls in 14MB of city data | Subpath exports: `@augustdev/ccs-fc/country` loads ~96KB |\n| **Query speed** | `getCitiesOfState` scans all 148K cities (O(n)) | O(1) lookups via hash maps and per-country files |\n| **Memory** | Parsing city.json allocates 30-50MB of heap | Per-country loading: `getCitiesOfState('IN', 'DL')` loads only 127KB |\n\n## Install\n\n```bash\nnpm i @augustdev/ccs-fc\n```\n\n## Usage\n\n### ES6 Modules\n\n```ts\n// Full import (same API as the original)\nimport { Country, State, City } from '@augustdev/ccs-fc';\n\n// Tree-shakeable subpath imports (recommended)\nimport Country from '@augustdev/ccs-fc/country'; // ~96KB\nimport State from '@augustdev/ccs-fc/state';     // ~550KB\nimport City from '@augustdev/ccs-fc/city';        // loads per-country on demand\n\n// Interfaces\nimport { ICountry, IState, ICity } from '@augustdev/ccs-fc';\n```\n\n### CommonJS\n\n```js\nconst { Country, State, City } = require('@augustdev/ccs-fc');\n\n// Or individual modules\nconst Country = require('@augustdev/ccs-fc/country').default;\nconst State = require('@augustdev/ccs-fc/state').default;\n```\n\n## API\n\n### Country\n\n#### `Country.getCountryByCode(countryCode)`\n\nReturns country details for a valid country code.\n\nReturns: `ICountry | undefined`\n\n```js\nCountry.getCountryByCode('IN')\n// {\n//   isoCode: \"IN\",\n//   name: \"India\",\n//   phonecode: \"91\",\n//   flag: \"🇮🇳\",\n//   currency: \"INR\",\n//   latitude: \"20.00000000\",\n//   longitude: \"77.00000000\",\n//   timezones: [{ zoneName: \"Asia/Kolkata\", gmtOffset: 19800, ... }]\n// }\n```\n\n#### `Country.getAllCountries()`\n\nReturns all countries.\n\nReturns: `ICountry[]`\n\n```js\nCountry.getAllCountries()\n// [{ isoCode: \"AD\", name: \"Andorra\", ... }, { isoCode: \"AE\", name: \"United Arab Emirates\", ... }, ...]\n```\n\n#### `Country.sortByIsoCode(countries)`\n\nSorts an array of countries by ISO code.\n\nReturns: `ICountry[]`\n\n---\n\n### State\n\n#### `State.getStatesOfCountry(countryCode)`\n\nReturns all states for a country.\n\nReturns: `IState[]`\n\n```js\nState.getStatesOfCountry('IN')\n// [{ name: \"Delhi\", isoCode: \"DL\", countryCode: \"IN\", latitude: \"28.70405920\", longitude: \"77.10249020\" }, ...]\n```\n\n#### `State.getStateByCodeAndCountry(stateCode, countryCode)`\n\nReturns a single state by its code and country code. O(1) lookup.\n\nReturns: `IState | undefined`\n\n```js\nState.getStateByCodeAndCountry('TG', 'IN')\n// { name: \"Telangana\", isoCode: \"TG\", countryCode: \"IN\", latitude: \"18.11243720\", longitude: \"79.01929970\" }\n```\n\n#### `State.getAllStates()`\n\nReturns all 4,963 states.\n\nReturns: `IState[]`\n\n#### `State.sortByIsoCode(states)`\n\nSorts an array of states by country code + ISO code.\n\nReturns: `IState[]`\n\n---\n\n### City\n\n#### `City.getCitiesOfState(countryCode, stateCode)`\n\nReturns all cities for a state. Only loads that country's data file on first call.\n\nReturns: `ICity[]`\n\n```js\nCity.getCitiesOfState('IN', 'DL')\n// [{ name: \"New Delhi\", countryCode: \"IN\", stateCode: \"DL\", latitude: \"28.63576\", longitude: \"77.22445\" }, ...]\n```\n\n#### `City.getCitiesOfCountry(countryCode)`\n\nReturns all cities for a country. Results are cached after first call.\n\nReturns: `ICity[]`\n\n```js\nCity.getCitiesOfCountry('ES')\n// [{ name: \"Madrid\", countryCode: \"ES\", stateCode: \"MD\", ... }, ...] // 6,692 cities\n```\n\n#### `City.getAllCities()`\n\nReturns all 148K cities. **Warning**: loads all 192 country files. Prefer `getCitiesOfCountry` or `getCitiesOfState` when possible.\n\nReturns: `ICity[]`\n\n#### `City.sortByStateAndName(cities)`\n\nSorts an array of cities by state code, then by name.\n\nReturns: `ICity[]`\n\n---\n\n## Interfaces\n\n```ts\ninterface ICountry {\n  name: string;\n  phonecode: string;\n  isoCode: string;\n  flag: string;\n  currency: string;\n  latitude: string;\n  longitude: string;\n  timezones?: Timezones[];\n}\n\ninterface IState {\n  name: string;\n  isoCode: string;\n  countryCode: string;\n  latitude?: string | null;\n  longitude?: string | null;\n}\n\ninterface ICity {\n  name: string;\n  countryCode: string;\n  stateCode: string;\n  latitude?: string | null;\n  longitude?: string | null;\n}\n```\n\n## Compatibility\n\n- **Node.js**: >= 12\n- **Bundlers**: Webpack, Vite, Rollup, esbuild (subpath exports require Node 16+ or bundler support)\n- **Formats**: ESM and CommonJS\n\n## Credits\n\nOptimized fork of [country-state-city](https://github.com/harpreetkhalsagtbit/country-state-city) by [Harpreet Singh](https://github.com/harpreetkhalsagtbit). Data sourced from [dr5hn/countries-states-cities-database](https://github.com/dr5hn/countries-states-cities-database).\n\n## License\n\nGPL-3.0\n","readmeFilename":"README.md"}