penambahan web socket

This commit is contained in:
2025-09-18 19:01:22 +07:00
parent 1d053646a9
commit d7bb2eb5bb
15070 changed files with 2402916 additions and 0 deletions

No files matched your search

@@ -0,0 +1,28 @@
import { resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import isInstalledGlobally from 'is-installed-globally';
const packageDir = resolve(fileURLToPath(import.meta.url), "../..");
const distDir = resolve(fileURLToPath(import.meta.url), "..");
const runtimeDir = resolve(distDir, "runtime");
const clientDir = resolve(distDir, "client");
const globalInstallMatch = [
"/yarn/global/",
"/pnpm/global/",
"/npm/global/",
"/.nvm/",
"/.volta/",
"/.fnm/",
// On Windows
"/nvm/versions/",
"/n/versions/"
// TODO: More info for other package managers
];
function isGlobalInstall() {
if (isInstalledGlobally === true || isInstalledGlobally.default === true)
return true;
const dir = packageDir.replace(/\\/g, "/");
return globalInstallMatch.some((i) => dir.includes(i));
}
export { clientDir, distDir, isGlobalInstall, packageDir, runtimeDir };