Skip to content

Instantly share code, notes, and snippets.

@jumoog
Created December 16, 2019 20:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jumoog/b80c30f1ec47112e2fc34c27e6f9b60a to your computer and use it in GitHub Desktop.
Save jumoog/b80c30f1ec47112e2fc34c27e6f9b60a to your computer and use it in GitHub Desktop.
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