{"id":24835754,"url":"https://github.com/tobilg/aws-edge-locations","last_synced_at":"2025-04-07T08:19:36.529Z","repository":{"id":53055807,"uuid":"198171976","full_name":"tobilg/aws-edge-locations","owner":"tobilg","description":"List of AWS edge location code prefixes","archived":false,"fork":false,"pushed_at":"2025-01-05T12:30:15.000Z","size":806,"stargazers_count":60,"open_issues_count":1,"forks_count":9,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-30T14:11:15.384Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/tobilg.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-22T07:37:19.000Z","updated_at":"2025-03-13T09:39:13.000Z","dependencies_parsed_at":"2024-02-15T05:22:35.695Z","dependency_job_id":"69e31cf8-bb2a-47a8-ab6f-4d84b7091b24","html_url":"https://github.com/tobilg/aws-edge-locations","commit_stats":{"total_commits":66,"total_committers":2,"mean_commits":33.0,"dds":"0.045454545454545414","last_synced_commit":"996dd77188333387489afeeee18a75f5213bd784"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobilg%2Faws-edge-locations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobilg%2Faws-edge-locations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobilg%2Faws-edge-locations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobilg%2Faws-edge-locations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tobilg","download_url":"https://codeload.github.com/tobilg/aws-edge-locations/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247615385,"owners_count":20967184,"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":[],"created_at":"2025-01-31T04:51:37.229Z","updated_at":"2025-04-07T08:19:36.504Z","avatar_url":"https://github.com/tobilg.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aws-edge-locations\nList of AWS CloudFront Edge Location code prefixes including latitude/longitude information, usable via a lookup mechanism.\n\n## Data\n\nIf you're here for the plain data, have a look at\n\n* [List of AWS CloudFront Edge Locations (as CSV)](data/aws-edge-locations.csv) \n* [List of AWS CloudFront Edge Locations (as JSON)](data/aws-edge-locations.json)\n* [List of AWS CloudFront Edge Locations (as Parquet)](data/aws-edge-locations.parquet)\n\n## Installation\nTo install, you can do the following:\n\n```bash\n$ npm i --save aws-edge-locations\n```\n\n## Usage\n\n### Node\n\nThis package can be used to lookup the AWS CloudFront Edge Locations via the three character prefix (the first three characters of the `location` (e.g. `IAD12`) field in the CloudFront logs).\n\n```javascript\nconst AWSEdgeLocations = require('aws-edge-locations').default;\n// Or\n// import AWSEdgeLocations from 'aws-edge-locations';\n\nconst el = new AWSEdgeLocations();\nconst location = el.lookup('IAD12'.substr(0,3)); // Use only the first three characters!\n\n/* returns\n{\n  \"city\": \"Washington\",\n  \"country\": \"United States\",\n  \"countryCode\": \"US\",\n  \"latitude\": 38.94449997,\n  \"longitude\": -77.45580292,\n  \"pricingRegion\": \"United States, Mexico, \u0026 Canada\"\n}\n*/\n\nconst invalid = el.lookup('FOO'); // returns false\n\n// Get edge location count\nconst locationCount = el.getLocationCount(); // returns the current number of locations\n```\n\n### Browser\n\nThis package is published as an UMD module, and can be used in the browser directly from [unpkg](https://unpkg.com/).\n\n```html\n\u003chtml\u003e\n    \u003chead\u003e\n        \u003cscript src=\"https://unpkg.com/aws-edge-locations\"\u003e\u003c/script\u003e \n    \u003c/head\u003e\n    \u003cbody\u003e\n        \u003cscript\u003e\n            // Using the global variable\n            document.write('There are ' + awsEdgeLocations.getLocationCount() + ' edge locations');\n        \u003c/script\u003e\n    \u003c/body\u003e\n\u003c/html\u003e\n```\n\n## Local data generation\n\nTo prepare the data regeneration, please run `npm run download-airports \u0026\u0026 npm run filter-airports`.\n\nThe `npm run generate` script will regenerate the `csv`, `json` and `parquet` versions of the AWS CloudFront Edge Location list in the `data` folder.\n\nIt does this by extracting the information from the [Amazon CloudFront Key Features page](https://aws.amazon.com/cloudfront/features/), cleaning and unifiying it, and merging it with [airport data](https://r2.datahub.io/clt98lrmc000fl708ilem2s44/master/raw/data/airport-codes.csv) (the first three characters of the `location` field are IATA airport codes) to also get the latitude/longitude information.\n\nAlso, there are some manual overrides when it wasn't possible to automatically determine the correct IATA code from the city names.\n\nRunning `npm run build` will transpile the TypeScript code in the `src` directory and save it in the `dist` directory.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftobilg%2Faws-edge-locations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftobilg%2Faws-edge-locations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftobilg%2Faws-edge-locations/lists"}