{"name":"win-detect-browsers","version":"4.0.1","description":"Fast and native browser detection on Windows","author":{"name":"Vincent Weevers"},"license":"MIT","main":"index.js","bin":{"win-detect-browsers":"cli.js"},"scripts":{"test":"standard && hallmark && node test.js","hallmark":"hallmark --fix"},"dependencies":{"after":"~0.8.2","chalk":"~2.4.1","debug":"~4.1.0","existent":"~1.0.1","pascal-case":"~2.0.1","pe-machine-type":"~1.0.0","pretty-tree":"~1.0.0","registry-js":"~1.8.0","which":"~1.3.0","win-version-info":"~3.0.0","windows-env":"~1.0.1","xtend":"^4.0.0","yargs":"~13.3.0"},"devDependencies":{"hallmark":"^1.0.0","standard":"^13.0.1","tape":"^4.10.1","win-dummy-exe":"0.0.1"},"repository":{"type":"git","url":"git+https://github.com/vweevers/win-detect-browsers.git"},"bugs":{"url":"https://github.com/vweevers/win-detect-browsers/issues"},"homepage":"https://github.com/vweevers/win-detect-browsers","keywords":["browser","browsers","detect","windows","chrome","chromium","canary","firefox","ie","internet-explorer","safari","opera","maxthon","yandex"],"engines":{"node":">=8"},"gitHead":"0286633d0262c3b0468cad93eebb482ec709da13","_id":"win-detect-browsers@4.0.1","_npmVersion":"6.4.1","_nodeVersion":"10.14.1","_npmUser":{"name":"vweevers","email":"dev@vincentweevers.nl"},"maintainers":[{"name":"vweevers","email":"dev@vincentweevers.nl"}],"dist":{"integrity":"sha512-/d9HJyslrlY24bDt/ouMBqg0TC9EysP1iAcA8hyoZTSLTqf79p81d2pnjdIv8jfF3E3946qXwrRfyKoTM0RyRA==","shasum":"99fb0b6116a6808b7fd0939e7ec79e534bce37c1","tarball":"http://registry-npm.ywwl.com/win-detect-browsers/download/win-detect-browsers-4.0.1.tgz","fileCount":14,"unpackedSize":42045,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdWAqHCRA9TVsSAnZWagAABz8P+we3lwD/bjlQHhVj5PbB\nJD80HMa+3QJV1JFFdCyRTlT/sbaf5L+pDlOXP4pGbg14FX44fxhA/x9/Dknj\nEmVgoSozfTd8RlWwF+t6r7Z39k2Ovjrk2JEACY4A297mCQC+gfPRs5Knz5sk\n1Up8z5NBYHDE1yyPIAhNH5Wedadd1r9JtV5CHRyZg9ZJTftPwUwmOJYPOYez\ncXTqPyu6JCWORzDKb/UM7bW5nWVTF1ALuG8KmhY7SMwgczs9RmdawYE2SWOk\n/V748atXlswMX8Dj/CBMkGh3iK3TUgzayJGFg9NbKAuflfmjVl/bWjcXjX0Y\nrP3pZt4Whg9DfsNRSKvsP1PdYeq3mxgx0G6beeR82RZBwfeyJFm9zPU1BJUs\nbLQXEfQR8j0fUbuPUqL8vBFdUfb3XuNyc6oxYXJRcJooaMc5WbZRv6X4FAVU\nAXeZ59tc3ApdShSiAfvodgTF8Xei2rSfLnU17+E+xm/DURn2aitgwdOfkPJ3\nPaWDsmAcE2pkDvIe0effQFkCl0qiV1KUV09RDZhBWpjvvV5xruLVYz/9tuLY\nrh3Ky95g6tb/Qcr8s06INTSf8AQRVrMFd16bteubVXW3H39i8sbKF+U8JQ4j\n6uDU9f4V0uzIfVejDOPWXTiNON7WBAi27jd6p/HCmEneGFnsOolxH2YrkHn6\nEkbO\r\n=hJJS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHRkoMx6qm0MPNRl4u+UG3S1EGZJwg/8MFRQQuLuDZ40AiBMpZg4/BJP6J5ivN3wjezuIfb4RzAdABapTvcNK9vWyQ=="}],"size":13062,"noattachment":false,"key":"/win-detect-browsers/-/win-detect-browsers-4.0.1.tgz"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/win-detect-browsers_4.0.1_1566050950679_0.051781474946629436"},"_hasShrinkwrap":false,"readme":"# win-detect-browsers\n\n**Fast and native browser detection on Windows. Detects installed versions of [Beaker](https://beakerbrowser.com/), [Brave](https://brave.com/), [Chrome](https://www.google.com/chrome/), [Chromium](https://www.chromium.org/), [Firefox](https://www.mozilla.org/en-US/firefox/), [Internet Explorer](https://en.wikipedia.org/wiki/Internet_Explorer), [Maxthon](http://www.maxthon.com/), [Opera](https://www.opera.com/), [Safari](https://www.apple.com/safari/) and [Yandex](https://browser.yandex.com/).**\n\n[![npm](https://img.shields.io/npm/v/win-detect-browsers.svg)](https://www.npmjs.com/package/win-detect-browsers)\n[![Node version](https://img.shields.io/node/v/win-detect-browsers.svg)](https://www.npmjs.com/package/win-detect-browsers)\n[![Test](https://img.shields.io/github/workflow/status/vweevers/win-detect-browsers/Test?label=test)](https://github.com/vweevers/win-detect-browsers/actions/workflows/test.yml)\n[![Standard](https://img.shields.io/badge/standard-informational?logo=javascript&logoColor=fff)](https://standardjs.com)\n[![Common Changelog](https://common-changelog.org/badge.svg)](https://common-changelog.org)\n\n## Table of Contents\n\n<details><summary>Click to expand</summary>\n\n- [Usage](#usage)\n- [API](#api)\n  - [`detect([names][, callback])`](#detectnames-callback)\n- [CLI](#cli)\n  - [Sample](#sample)\n- [Install](#install)\n- [Background](#background)\n- [License](#license)\n\n</details>\n\n## Usage\n\n_If you are upgrading: please see the [changelog](CHANGELOG.md)._\n\n```js\nconst detect = require('win-detect-browsers')\n\n// All browsers\ndetect(function (err, browsers) {\n  if (err) throw err\n  console.log(browsers)\n})\n\n// All browsers with promise\nconst browsers = await detect()\n\n// Search only for Chrome and Firefox\ndetect(['chrome', 'firefox'], function (err, browsers) {\n  if (err) throw err\n\n  for (let b of browsers) {\n    console.log(b.version) // '57.0.2931.0'\n    console.log(b.channel) // 'canary'\n  }\n})\n```\n\n## API\n\n### `detect([names][, callback])`\n\n`names` is an array of browser names you want to find. If omitted or empty, it will detect _[everything](http://youtu.be/k1yvvNvlXtg)_. The `callback` receives an error if any and an array of `results`. A result is excluded if its path has no `.exe` extension or if its version could not be read. If no callback is provided, a promise is returned.\n\nEach `result` is an object with the following properties:\n\n- `name` (string): `chrome`, `chromium`, `firefox`, `beaker`, `brave`, `ie`, `msedge`, `maxthon`, `opera`, `safari`, `yandex`\n- `path` (string): absolute path to executable\n- `version` (string)\n- `arch` (string): CPU type the executable was built for: `amd64`, `i386` or [other](https://github.com/vweevers/pe-machine-type#types);\n- `info` (object): executable metadata (see [sample](#sample) below).\n\nAdditional properties are usually available but not guaranteed:\n\n- `channel` (string):\n  - Chrome: `stable`, `canary`, `beta` or `dev`\n  - Firefox: `release`, `developer`, `nightly` or [`esr`](https://www.mozilla.org/en-US/firefox/organizations/faq/)\n  - Older versions of Firefox: `aurora`, `beta` or `rc`;\n  - Opera: `stable`, `beta` or `developer`.\n\n## CLI\n\n```\nwin-detect-browsers [options] [name, name..]\n```\n\nWrite browsers to stdout as a JSON array. Includes all browsers unless one or more names are given (see list above).\n\nOptions:\n\n- `--help` `-h`: Show help\n- `--version` `-v`: Show CLI version number\n- `--summary` `-s`: Less properties;\n- `--debug` `-d`: Enable debug output.\n\n### Sample\n\nOn Windows 10:\n\n<details><summary>Click to expand</summary>\n\n```json\n[\n  {\n    \"name\": \"ie\",\n    \"path\": \"C:\\\\Program Files\\\\Internet Explorer\\\\iexplore.exe\",\n    \"version\": \"11.0.17134.1\",\n    \"arch\": \"amd64\",\n    \"info\": {\n      \"FileVersion\": \"11.0.17134.1\",\n      \"CompanyName\": \"Microsoft Corporation\",\n      \"FileDescription\": \"Internet Explorer\",\n      \"InternalName\": \"iexplore\",\n      \"LegalCopyright\": \"© Microsoft Corporation. Alle rechten voorbehouden.\",\n      \"OriginalFilename\": \"IEXPLORE.EXE.MUI\",\n      \"ProductName\": \"Internet Explorer\",\n      \"ProductVersion\": \"11.00.17134.1\"\n    }\n  },\n  {\n    \"name\": \"ie\",\n    \"path\": \"C:\\\\Program Files (x86)\\\\Internet Explorer\\\\iexplore.exe\",\n    \"version\": \"11.0.17134.1\",\n    \"arch\": \"i386\",\n    \"info\": {\n      \"FileVersion\": \"11.0.17134.1\",\n      \"CompanyName\": \"Microsoft Corporation\",\n      \"FileDescription\": \"Internet Explorer\",\n      \"InternalName\": \"iexplore\",\n      \"LegalCopyright\": \"© Microsoft Corporation. Alle rechten voorbehouden.\",\n      \"OriginalFilename\": \"IEXPLORE.EXE.MUI\",\n      \"ProductName\": \"Internet Explorer\",\n      \"ProductVersion\": \"11.00.17134.1\"\n    }\n  },\n  {\n    \"name\": \"firefox\",\n    \"path\": \"C:\\\\Program Files\\\\Mozilla Firefox\\\\firefox.exe\",\n    \"version\": \"61.0.0.6711\",\n    \"channel\": \"release\",\n    \"arch\": \"amd64\",\n    \"info\": {\n      \"FileVersion\": \"61.0.0.6711\",\n      \"LegalCopyright\": \"©Firefox and Mozilla Developers; available under the MPL 2 license.\",\n      \"CompanyName\": \"Mozilla Corporation\",\n      \"FileDescription\": \"Firefox\",\n      \"ProductVersion\": \"61.0\",\n      \"InternalName\": \"Firefox\",\n      \"LegalTrademarks\": \"Firefox is a Trademark of The Mozilla Foundation.\",\n      \"OriginalFilename\": \"../../dist/bin/firefox.exe\",\n      \"ProductName\": \"Firefox\",\n      \"BuildID\": \"20180517141400\"\n    }\n  },\n  {\n    \"name\": \"firefox\",\n    \"path\": \"C:\\\\Program Files\\\\Firefox Developer Edition\\\\firefox.exe\",\n    \"version\": \"61.0.0.6711\",\n    \"channel\": \"developer\",\n    \"arch\": \"amd64\",\n    \"info\": {\n      \"FileVersion\": \"61.0.0.6711\",\n      \"LegalCopyright\": \"©Firefox and Mozilla Developers; available under the MPL 2 license.\",\n      \"CompanyName\": \"Mozilla Corporation\",\n      \"FileDescription\": \"Firefox Developer Edition\",\n      \"ProductVersion\": \"61.0\",\n      \"InternalName\": \"Firefox Developer Edition\",\n      \"LegalTrademarks\": \"Firefox is a Trademark of The Mozilla Foundation.\",\n      \"OriginalFilename\": \"../../dist/bin/firefox.exe\",\n      \"ProductName\": \"Firefox Developer Edition\",\n      \"BuildID\": \"20180517141400\"\n    }\n  },\n  {\n    \"name\": \"firefox\",\n    \"path\": \"C:\\\\Program Files\\\\Firefox Nightly\\\\firefox.exe\",\n    \"version\": \"62.0.0.6712\",\n    \"channel\": \"nightly\",\n    \"arch\": \"amd64\",\n    \"info\": {\n      \"FileVersion\": \"62.0.0.6712\",\n      \"LegalCopyright\": \"©Firefox and Mozilla Developers; available under the MPL 2 license.\",\n      \"CompanyName\": \"Mozilla Corporation\",\n      \"FileDescription\": \"Firefox Nightly\",\n      \"ProductVersion\": \"62.0a1\",\n      \"InternalName\": \"Firefox Nightly\",\n      \"LegalTrademarks\": \"Firefox is a Trademark of The Mozilla Foundation.\",\n      \"OriginalFilename\": \"firefox.exe\",\n      \"ProductName\": \"Firefox Nightly\",\n      \"BuildID\": \"20180518222751\"\n    }\n  },\n  {\n    \"name\": \"chrome\",\n    \"path\": \"C:\\\\Users\\\\vweevers\\\\AppData\\\\Local\\\\Google\\\\Chrome SxS\\\\Application\\\\chrome.exe\",\n    \"version\": \"68.0.3436.0\",\n    \"channel\": \"canary\",\n    \"arch\": \"amd64\",\n    \"info\": {\n      \"FileVersion\": \"68.0.3436.0\",\n      \"CompanyName\": \"Google Inc.\",\n      \"FileDescription\": \"Google Chrome\",\n      \"InternalName\": \"chrome_exe\",\n      \"LegalCopyright\": \"Copyright 2017 Google Inc. All rights reserved.\",\n      \"OriginalFilename\": \"chrome.exe\",\n      \"ProductName\": \"Google Chrome\",\n      \"ProductVersion\": \"68.0.3436.0\",\n      \"CompanyShortName\": \"Google\",\n      \"ProductShortName\": \"Chrome\",\n      \"LastChange\": \"e0f81fe637f233bf12e821915b72bc8d2194c3f2-refs/branch-heads/3436@{#1}\",\n      \"Official Build\": \"1\"\n    }\n  },\n  {\n    \"name\": \"chrome\",\n    \"path\": \"C:\\\\Program Files (x86)\\\\Google\\\\Chrome\\\\Application\\\\chrome.exe\",\n    \"version\": \"66.0.3359.181\",\n    \"channel\": \"stable\",\n    \"arch\": \"amd64\",\n    \"info\": {\n      \"FileVersion\": \"66.0.3359.181\",\n      \"CompanyName\": \"Google Inc.\",\n      \"FileDescription\": \"Google Chrome\",\n      \"InternalName\": \"chrome_exe\",\n      \"LegalCopyright\": \"Copyright 2017 Google Inc. All rights reserved.\",\n      \"OriginalFilename\": \"chrome.exe\",\n      \"ProductName\": \"Google Chrome\",\n      \"ProductVersion\": \"66.0.3359.181\",\n      \"CompanyShortName\": \"Google\",\n      \"ProductShortName\": \"Chrome\",\n      \"LastChange\": \"a10b9cedb40738cb152f8148ddab4891df876959-refs/branch-heads/3359@{#828}\",\n      \"Official Build\": \"1\"\n    }\n  },\n  {\n    \"name\": \"opera\",\n    \"path\": \"C:\\\\Program Files\\\\Opera beta\\\\Launcher.exe\",\n    \"version\": \"53.0.2907.31\",\n    \"channel\": \"beta\",\n    \"arch\": \"amd64\",\n    \"info\": {\n      \"FileVersion\": \"53.0.2907.31\",\n      \"LegalCopyright\": \"Copyright Opera Software 2018\",\n      \"InternalName\": \"Opera\",\n      \"CompanyName\": \"Opera Software\",\n      \"ProductName\": \"Opera beta Internet Browser\",\n      \"ProductVersion\": \"53.0.2907.31\",\n      \"FileDescription\": \"Opera beta Internet Browser\"\n    }\n  }\n]\n```\n\n</details>\n\n## Install\n\nWith [npm](https://npmjs.org) do:\n\n```bash\nnpm install win-detect-browsers     # For API\nnpm install win-detect-browsers -g  # For CLI\n```\n\n## Background\n\nBrowser detection on Windows can't be done right. This is the _try-everything-and-fail-silently_ approach. It accounts for architecture differences, normalizes environment variables, tries default locations, searches the registry (in the HKLM and HKCU hives as well as WoW counterparts) (including [Start Menu Internet Applications](http://msdn.microsoft.com/en-us/library/windows/desktop/dd203067(v=vs.85).aspx), Google Updater and more), and looks in `PATH`. Version numbers are then read from the executable metadata.\n\n`browser-launcher` by substack has [poor Windows support](https://github.com/substack/browser-launcher/issues/7), and it prompted me to create this module. It is now used in [browser-launcher2](https://github.com/benderjs/browser-launcher2), ~~an active~~ a once active fork of `browser-launcher`.\n\n## License\n\n[MIT](./LICENSE)\n","publish_time":1566050950814,"_cnpm_publish_time":1566050950814,"dist-tags":{"latest":"8.0.3","next":"3.0.0-rc1"}}