UNPKG

1.67 kBMarkdownView Raw
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
6Possible paths or binary names of [Edge](https://www.microsoft.com/en-us/edge) in the current platform
7
8```javascript
9const edgePaths = require("edge-paths");
10
11// On macOS
12
13edgePaths.edge; //=> '/Users/quantum/Desktop/code/edge-paths/node_modules/edge-launcher/dist/x86/MicrosoftEdgeLauncher.exe'
14
15// On Linux
16
17edgePaths.edge; //=> 'edge'
18
19// On Windows
20
21edgePaths.edge; //=> 'C:\\Program Files (x86)\\Microsoft\\Edge Dev\\Application\\msedge.exe'
22
23// On Solaris (Unsupported platform)
24
25edgePaths.edge; //=> null
26```
27
28## Installation
29
30[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/about-npm/).
31
32```
33npm install edge-paths
34```
35
36## API
37
38```javascript
39const edgePaths = require("edge-paths");
40```
41
42### edgePaths.chrome, edgePaths.chromeCanary, edgePaths.chromium
43
44Type: `string` or `null`
45
46```javascript
47const { execFile } = require("child_process");
48const { promisify } = require("util");
49const { 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
57Whether 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