-
-
Notifications
You must be signed in to change notification settings - Fork 935
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0e8582f
commit 6f84051
Showing
1 changed file
with
9 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
const got = require("got"); | ||
const ISS = "http://api.open-notify.org/iss-now.json"; | ||
const got = require('got'); | ||
|
||
(await got(ISS).json()).iss_position; | ||
(async () => { | ||
const issUrl = 'http://api.open-notify.org/iss-now.json'; | ||
|
||
const {iss_position: issPosition} = await got(issUrl).json(); | ||
|
||
console.log(issPosition); | ||
//=> {latitude: '20.4956', longitude: '42.2216'} | ||
})(); |
6f84051
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of the features of having
as the last line was that Runkit showed a map with the coordinates.
6f84051
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sindresorhus Can you revert this?
6f84051
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While nice, that is unrelated to showing off Got, which this example is about. It's not about showing off RunKit features. I'd rather have readable code.
6f84051
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually it still opens the map if you click the dropdown icon :)