1 | # Edge Paths
|
2 |
|
3 | [![npm version](https://img.shields.io/npm/v/edge-paths.svg)](https://www.npmjs.com/package/edge-paths)
|
4 | [![Build Status](https://travis-ci.com/shinnn/edge-paths.svg?branch=master)](https://travis-ci.com/shinnn/edge-paths)
|
5 |
|
6 | Possible paths or binary names of [Edge](https://www.microsoft.com/en-us/edge) in the current platform
|
7 |
|
8 | ```javascript
|
9 | const edgePaths = require("edge-paths");
|
10 |
|
11 | // On macOS
|
12 |
|
13 | edgePaths.edge; //=> '/Users/quantum/Desktop/code/edge-paths/node_modules/edge-launcher/dist/x86/MicrosoftEdgeLauncher.exe'
|
14 |
|
15 | // On Linux
|
16 |
|
17 | edgePaths.edge; //=> 'edge'
|
18 |
|
19 | // On Windows
|
20 |
|
21 | edgePaths.edge; //=> 'C:\\Program Files (x86)\\Microsoft\\Edge Dev\\Application\\msedge.exe'
|
22 |
|
23 | // On Solaris (Unsupported platform)
|
24 |
|
25 | edgePaths.edge; //=> null
|
26 | ```
|
27 |
|
28 | ## Installation
|
29 |
|
30 | [Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/about-npm/).
|
31 |
|
32 | ```
|
33 | npm install edge-paths
|
34 | ```
|
35 |
|
36 | ## API
|
37 |
|
38 | ```javascript
|
39 | const edgePaths = require("edge-paths");
|
40 | ```
|
41 |
|
42 | ### edgePaths.chrome, edgePaths.chromeCanary, edgePaths.chromium
|
43 |
|
44 | Type: `string` or `null`
|
45 |
|
46 | ```javascript
|
47 | const { execFile } = require("child_process");
|
48 | const { promisify } = require("util");
|
49 | const { chrome, chromeCanary } = require("edge-paths");
|
50 |
|
51 | (async () => {
|
52 | (await promisify(execFile)(chrome, ["--version"])).stdout; //=> 'Google Chrome 71.0.3578.98 \n'
|
53 | (await promisify(execFile)(chromeCanary, ["--version"])).stdout; //=> 'Google Chrome 74.0.3689.0 canary\n'
|
54 | })();
|
55 | ```
|
56 |
|
57 | Whether each property is a full path, just a binary name or `null` depends on the current [platform](https://nodejs.org/api/process.html#process_process_platform).
|
58 |
|
59 | ## License
|
60 |
|
61 | [ISC License](./LICENSE) © 2020 Shirshak Bajgain
|