UNPKG

437 BJavaScriptView Raw
1var global = require('../internals/global');
2var userAgent = require('../internals/user-agent');
3
4var process = global.process;
5var versions = process && process.versions;
6var v8 = versions && versions.v8;
7var match, version;
8
9if (v8) {
10 match = v8.split('.');
11 version = match[0] + match[1];
12} else if (userAgent) {
13 match = userAgent.match(/Chrome\/(\d+)/);
14 if (match) version = match[1];
15}
16
17module.exports = version && +version;