https://github.com/tobilg/azure-edge-locations
Approximation of Azure edge locations
https://github.com/tobilg/azure-edge-locations
Last synced: 7 months ago
JSON representation
Approximation of Azure edge locations
- Host: GitHub
- URL: https://github.com/tobilg/azure-edge-locations
- Owner: tobilg
- License: mit
- Created: 2021-12-31T15:21:21.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-10-05T17:55:14.000Z (10 months ago)
- Last Synced: 2025-10-14T10:33:10.330Z (10 months ago)
- Language: TypeScript
- Size: 192 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# azure-edge-locations
Approximation of Azure edge locations, usable via a lookup mechanism.
## Installation
To install, you can do the following:
```bash
$ npm i azure-edge-locations
```
This package includes TypeScript definitions and is written in TypeScript for better type safety and developer experience.
## Usage
### Node (JavaScript)
```javascript
const AzureEdgeLocations = require('azure-edge-locations');
const el = new AzureEdgeLocations();
const location = el.lookup('ATL');
/* returns
{
"city": "Atlanta",
"country": "United States",
"countryCode": "US",
"latitude": 33.6367,
"longitude": -84.428101,
"count": 3
}
*/
const invalid = el.lookup('FOO'); // returns false
// Get edge location count
const locationCount = el.getLocationCount(); // returns 104
// Get all edge locations
const locations = el.getLocations();
// Get PoP count
const popCount = el.getPoPCount() // returns 182
```
### Node (TypeScript)
```typescript
import { AzureEdgeLocations } from 'azure-edge-locations';
const el = new AzureEdgeLocations();
const location = el.lookup('ATL');
/* returns
{
"city": "Atlanta",
"country": "United States",
"countryCode": "US",
"latitude": 33.6367,
"longitude": -84.428101,
"count": 3
}
*/
const invalid = el.lookup('FOO'); // returns false
// Get edge location count
const locationCount = el.getLocationCount(); // returns 104
// Get all edge locations
const locations = el.getLocations();
// Get PoP count
const popCount = el.getPoPCount() // returns 182
```
### Browser
This package is published as an UMD module, and can be used in the browser directly from [unpkg](https://unpkg.com/).
```html
// Using the global variable
document.write('There are ' + azureEdgeLocations.getLocationCount() + ' edge locations');
```
## Data generation
### TLDR
Run `npm run build`
## Data
This project is considered as in the `alpha` stage, so there's **no guarantee that the data is accurate**. Please feel free to test and give feedback either via creating an [issue](https://github.com/tobilg/azure-edge-locations/issues) or a [pr](https://github.com/tobilg/azure-edge-locations/pulls)
The data files can be found at
* [data/azure-edge-locations.csv](data/azure-edge-locations.csv)
* [data/azure-edge-locations.json](data/azure-edge-locations.json)