{"name":"win-detect-browsers","version":"0.0.2","bin":{"win-detect-browsers":"./bin/detect-browsers"},"description":"Detect browsers on Windows","main":"index.js","dependencies":{"which":"^1.0.5"},"devDependencies":{},"scripts":{},"repository":{"type":"git","url":"https://github.com/vweevers/win-detect-browsers"},"keywords":["browser","detect","windows"],"author":{"name":"Vincent Weevers"},"license":"MIT","bugs":{"url":"https://github.com/vweevers/win-detect-browsers/issues"},"homepage":"https://github.com/vweevers/win-detect-browsers","gitHead":"c5a9a93b23733bb0d306bd79ce65dd73d74a01ad","_id":"win-detect-browsers@0.0.2","_shasum":"d636ade6434c9967c7e7af592a0b4aa2ba9d22f2","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"vweevers","email":"dev@vincentweevers.nl"},"maintainers":[{"name":"vweevers","email":"dev@vincentweevers.nl"}],"dist":{"shasum":"d636ade6434c9967c7e7af592a0b4aa2ba9d22f2","tarball":"http://registry-npm.ywwl.com/win-detect-browsers/download/win-detect-browsers-0.0.2.tgz","integrity":"sha512-KkkCzepb8RUAjZRVlDCoG2XZhLPXmCr2ToLY7+uhYjIbaYF75HVPe1td4/T7/CCkAZ3lpfFzkjpYW4p/lE/95g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFOpFkSR2X7vN619szUISHlGxUym6Nxp/OT0qDzNg7rFAiEA1ifKrdCGGiNZaY577Mp0aio7zRWBG3Pe0QwMYxHcjdk="}],"size":4386,"noattachment":false,"key":"/win-detect-browsers/-/win-detect-browsers-0.0.2.tgz"},"directories":{},"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":1406800637676,"_cnpm_publish_time":1406800637676,"dist-tags":{"latest":"8.0.3","next":"3.0.0-rc1"}}