@matterbridge/utils 3.9.2-dev-20260625-1591faa → 3.9.2-dev-20260625-a8359b3
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.
- package/dist/bunPrefix.d.ts +1 -0
- package/dist/bunPrefix.js +6 -0
- package/dist/npmPrefix.js +2 -3
- package/package.json +1 -1
package/dist/bunPrefix.d.ts
CHANGED
package/dist/bunPrefix.js
CHANGED
|
@@ -2,7 +2,13 @@ import os from 'node:os';
|
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { logModuleLoaded } from './loader.js';
|
|
4
4
|
logModuleLoaded('BunPrefix');
|
|
5
|
+
export function isBun() {
|
|
6
|
+
return typeof process !== 'undefined' && process.versions?.bun !== undefined;
|
|
7
|
+
}
|
|
5
8
|
export function getGlobalBunModules() {
|
|
9
|
+
if (!isBun()) {
|
|
10
|
+
throw new Error('getGlobalBunModules can only be called in a Bun environment.');
|
|
11
|
+
}
|
|
6
12
|
const bunInstall = process.env.BUN_INSTALL ?? path.join(os.homedir(), '.bun');
|
|
7
13
|
return path.join(bunInstall, 'install', 'global', 'node_modules');
|
|
8
14
|
}
|
package/dist/npmPrefix.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { getGlobalBunModules } from './bunPrefix.js';
|
|
2
|
-
import { hasParameter } from './commandLine.js';
|
|
1
|
+
import { getGlobalBunModules, isBun } from './bunPrefix.js';
|
|
3
2
|
import { logModuleLoaded } from './loader.js';
|
|
4
3
|
logModuleLoaded('NpmPrefix');
|
|
5
4
|
export async function getGlobalNodeModules() {
|
|
6
|
-
if (
|
|
5
|
+
if (isBun())
|
|
7
6
|
return getGlobalBunModules();
|
|
8
7
|
const { exec } = await import('node:child_process');
|
|
9
8
|
return new Promise((resolve, reject) => {
|
package/package.json
CHANGED