Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@vitest-preview/dev-utils

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vitest-preview/dev-utils - npm Package Compare versions

Comparing version
0.0.1
to
0.0.2-alpha.0
+59
dist/index.mjs
import { execSync } from 'child_process';
import path from 'path';
import { fileURLToPath } from 'url';
import open from 'open';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
var OSX_CHROME = "google chrome";
function openBrowser(url) {
let browser = process.env.BROWSER;
if (browser === "none") {
return false;
}
const shouldTryOpenChromeWithAppleScript = process.platform === "darwin" && (typeof browser !== "string" || browser === OSX_CHROME);
if (shouldTryOpenChromeWithAppleScript) {
const supportedChromiumBrowsers = [
"Google Chrome Canary",
"Google Chrome Dev",
"Google Chrome Beta",
"Google Chrome",
"Microsoft Edge",
"Brave Browser",
"Vivaldi",
"Chromium"
];
for (let chromiumBrowser of supportedChromiumBrowsers) {
try {
execSync(`ps cax | grep "${chromiumBrowser}"`);
execSync(
`osascript openChrome.applescript "${encodeURI(
url
)}" "${chromiumBrowser}"`,
{
cwd: __dirname,
stdio: "ignore"
}
);
return true;
} catch (err) {
}
}
}
if (process.platform === "darwin" && browser === "open") {
browser = void 0;
}
try {
var options = { app: browser };
open(url, options).catch(() => {
});
return true;
} catch (err) {
return false;
}
}
var index = {
openBrowser
};
export { index as default, openBrowser };
MIT License
Copyright (c) 2022 Hung Viet Nguyen
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+7
-11
{
"name": "@vitest-preview/dev-utils",
"version": "0.0.1",
"version": "0.0.2-alpha.0",
"description": "",
"type": "module",
"main": "dist/index.js",
"module": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",

@@ -19,17 +19,13 @@ "files": [

"devDependencies": {
"@rollup/plugin-commonjs": "^23.0.2",
"@rollup/plugin-json": "^5.0.1",
"@rollup/plugin-node-resolve": "^15.0.1",
"rollup": "^3.2.3",
"rollup-plugin-dts": "^5.0.0",
"rollup-plugin-esbuild": "^4.10.1"
"@types/node": "^20.14.6",
"pkgroll": "2.1.1"
},
"dependencies": {
"open": "^8.4.0"
"open": "^10.1.0"
},
"scripts": {
"copy": "mkdir dist && cp src/openChrome.applescript dist/openChrome.applescript",
"build": "rimraf dist && pnpm run copy && rollup -c",
"build:watch": "rimraf dist && pnpm run copy && rollup -c -w"
"build": "rimraf dist && pnpm run copy && pkgroll",
"build:watch": "rimraf dist && pnpm run copy && pkgroll --watch"
}
}