Created
December 16, 2019 20:34
-
-
Save jumoog/b80c30f1ec47112e2fc34c27e6f9b60a to your computer and use it in GitHub Desktop.
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
const phin = require('phin'); | |
const _ = require('underscore'); | |
async function getLatestChromeVersion() { | |
let res = await phin({ | |
url: 'https://omahaproxy.appspot.com/all.json', | |
parse: 'json' | |
}); | |
if (res.statusCode === 200) { | |
let cros_os = _.find(res.body, { | |
'os': 'win64' | |
}); | |
let browserVersion = _.find(cros_os.versions, { | |
'channel': 'stable' | |
}); | |
return browserVersion.version; | |
} | |
} | |
getLatestChromeVersion().then(response => console.log(response)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment