Socket
Socket
Sign inDemoInstall

edgedriver

Package Overview
Dependencies
Maintainers
2
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

edgedriver - npm Package Compare versions

Comparing version 5.5.0 to 5.6.0

37

dist/install.js
import path from 'node:path';
import fs from 'node:fs';
import fsp from 'node:fs/promises';
import fsp, { writeFile } from 'node:fs/promises';
import os from 'node:os';
import cp from 'node:child_process';
import { format } from 'node:util';
import { Readable } from 'node:stream';
import fetch from 'node-fetch';
import unzipper from 'unzipper';
import { BlobReader, BlobWriter, ZipReader } from '@zip.js/zip.js';
import findEdgePath from './finder.js';

@@ -35,3 +33,3 @@ import { TAGGED_VERSIONS, EDGE_PRODUCTS_API, TAGGED_VERSION_URL, LATEST_RELEASE_URL, DOWNLOAD_URL, BINARY_FILE, log } from './constants.js';

await fsp.mkdir(cacheDir, { recursive: true });
await downloadZip(res.body, cacheDir);
await downloadZip(res, cacheDir);
await fsp.chmod(binaryFilePath, '755');

@@ -132,14 +130,9 @@ log.info('Finished downloading Edgedriver');

}
function downloadZip(body, cacheDir) {
const stream = Readable.from(body).pipe(unzipper.Parse());
const promiseChain = [
new Promise((resolve, reject) => {
stream.on('close', () => resolve());
stream.on('error', () => reject());
})
];
stream.on('entry', async (entry) => {
const unzippedFilePath = path.join(cacheDir, entry.path);
if (entry.type === 'Directory') {
return;
async function downloadZip(res, cacheDir) {
const zipBlob = await res.blob();
const zip = new ZipReader(new BlobReader(zipBlob));
for (const entry of await zip.getEntries()) {
const unzippedFilePath = path.join(cacheDir, entry.filename);
if (entry.directory) {
continue;
}

@@ -149,9 +142,5 @@ if (!await hasAccess(path.dirname(unzippedFilePath))) {

}
const execStream = entry.pipe(fs.createWriteStream(unzippedFilePath));
promiseChain.push(new Promise((resolve, reject) => {
execStream.on('close', () => resolve(unzippedFilePath));
execStream.on('error', reject);
}));
});
return Promise.all(promiseChain);
const content = await entry.getData(new BlobWriter());
await writeFile(unzippedFilePath, content.stream());
}
}

@@ -158,0 +147,0 @@ /**

{
"name": "edgedriver",
"version": "5.5.0",
"version": "5.6.0",
"description": "Microsofts' EdgeDriver for Node.js",

@@ -50,3 +50,2 @@ "homepage": "https://webdriver.io",

"@types/node": "^20.12.12",
"@types/unzipper": "^0.10.9",
"@typescript-eslint/eslint-plugin": "^7.9.0",

@@ -72,5 +71,5 @@ "@typescript-eslint/parser": "^7.9.0",

"node-fetch": "^3.3.2",
"unzipper": "^0.11.6",
"which": "^4.0.0"
"which": "^4.0.0",
"@zip.js/zip.js": "^2.7.44"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc