Skip to content

Conversation

@rizaljamhari
Copy link
Contributor

This MR adds support for displaying the server location(s) used by the speed test.

Changes

1. Data Model Updates

  • SpeedData Interface (source/types.ts): Added a new field serverLocations of type string[]. This stores the list of server locations used for the test.

2. API Updates

  • Scraping Logic: Updated the monitorSpeed function to scrape the #server-locations element from the page.
  • Parsing: The text content is split by the | delimiter to handle multiple server locations, trimmed, and stored as an array.

3. UI Updates

  • Verbose Output:
    • Displays multiple server locations separated by |.
  • JSON Output:
    • Included the serverLocations array in the JSON output when the --json flag is used.

Example Verbose Output

fast-verbose

Example JSON Output

{
	"downloadSpeed": 190,
	"downloadUnit": "Mbps",
	"downloaded": 190,
	"uploaded": 0,
	"latency": 226,
	"bufferBloat": 231,
	"userLocation": "Oregon, US",
	"serverLocations": [
		"Seattle, US",
		"San Jose, US"
	],
	"userIp": "1xx.xxx.xxx"
}

@sindresorhus sindresorhus merged commit 8811ae5 into sindresorhus:main Jan 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants