browser-webdriver-downloader 2.0.2 → 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +4 -4
  2. package/src/index.js +8 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "browser-webdriver-downloader",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "description": "Install and wrap msedgedriver in Node.js",
5
5
  "bin": {
6
6
  "msedgedriver": "bin/msedgedriver.js"
@@ -46,9 +46,9 @@
46
46
  "extract-zip": "^2.0.1",
47
47
  "find-edge-version": "0.1.1",
48
48
  "fs-extra": "^11.0.0",
49
- "got": "^11.8.5",
49
+ "got": "^12.0.0",
50
50
  "tmp": "0.2.1",
51
- "yn": "^4.0.0"
51
+ "yn": "^5.0.0"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@crowdstrike/commitlint": "^7.0.0",
@@ -63,7 +63,7 @@
63
63
  "eslint-plugin-node": "^11.0.0",
64
64
  "mocha": "^10.0.0",
65
65
  "mocha-helpers": "^8.0.0",
66
- "remark-cli": "^11.0.0",
66
+ "remark-cli": "^12.0.0",
67
67
  "remark-preset-lint-crowdstrike": "^3.0.0",
68
68
  "renovate-config-standard": "^2.0.0",
69
69
  "standard-node-template": "4.0.1",
package/src/index.js CHANGED
@@ -1,6 +1,5 @@
1
1
  'use strict';
2
2
 
3
- const got = require('got');
4
3
  const { promisify } = require('util');
5
4
  const fs = { ...require('fs'), ...require('fs').promises, ...require('../src/fs') };
6
5
  const path = require('path');
@@ -9,7 +8,6 @@ const pipeline = promisify(require('stream').pipeline);
9
8
  const os = require('os');
10
9
  const { createTmpDir } = require('../src/tmp');
11
10
  const execa = require('execa');
12
- const yn = require('yn');
13
11
 
14
12
  const platform = os.platform();
15
13
  const arch = os.arch();
@@ -50,6 +48,8 @@ function getDownloadName() {
50
48
  async function getDriverVersion() {
51
49
  let version;
52
50
 
51
+ const { default: yn } = await import('yn');
52
+
53
53
  if (process.env.EDGEDRIVER_VERSION) {
54
54
  version = process.env.EDGEDRIVER_VERSION;
55
55
  } else if (yn(process.env.DETECT_EDGEDRIVER_VERSION)) {
@@ -117,6 +117,9 @@ async function getDetectedDriverVersion() {
117
117
  }
118
118
 
119
119
  async function getLatestDriverVersion() {
120
+ // eslint-disable-next-line node/no-missing-import
121
+ const { got } = await import('got');
122
+
120
123
  let { body } = await got.get(`${downloadHost}/LATEST_STABLE`);
121
124
 
122
125
  // For example: '��102.0.1245.33\r\n'
@@ -191,6 +194,9 @@ async function download({ tmpPath, version }) {
191
194
 
192
195
  console.log(`Downloading ${downloadUrl}...`);
193
196
 
197
+ // eslint-disable-next-line node/no-missing-import
198
+ const { got } = await import('got');
199
+
194
200
  await pipeline(
195
201
  got.stream(downloadUrl),
196
202
  fs.createWriteStream(downloadPath),