@matterbridge/utils 3.9.2-dev-20260624-3362db6 → 3.9.2-dev-20260625-1591faa

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.
@@ -0,0 +1 @@
1
+ export declare function getGlobalBunModules(): string;
@@ -0,0 +1,8 @@
1
+ import os from 'node:os';
2
+ import path from 'node:path';
3
+ import { logModuleLoaded } from './loader.js';
4
+ logModuleLoaded('BunPrefix');
5
+ export function getGlobalBunModules() {
6
+ const bunInstall = process.env.BUN_INSTALL ?? path.join(os.homedir(), '.bun');
7
+ return path.join(bunInstall, 'install', 'global', 'node_modules');
8
+ }
package/dist/export.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from './bunPrefix.js';
1
2
  export * from './colorUtils.js';
2
3
  export * from './commandLine.js';
3
4
  export * from './copyDirectory.js';
package/dist/export.js CHANGED
@@ -1,3 +1,4 @@
1
+ export * from './bunPrefix.js';
1
2
  export * from './colorUtils.js';
2
3
  export * from './commandLine.js';
3
4
  export * from './copyDirectory.js';
package/dist/loader.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export function logModuleLoaded(moduleName, color = '\u001B[32m') {
2
- if (process.argv.includes('--loader') || process.argv.includes('-loader')) {
2
+ if (process.argv.includes('--loader')) {
3
3
  console.log(`${color}[` +
4
4
  new Date().toLocaleTimeString('en-US', { hour12: false, hour: '2-digit', minute: '2-digit', second: '2-digit', fractionalSecondDigits: 3 }) +
5
5
  `] ${moduleName} loaded.\u001B[40;0m`);
package/dist/npmPrefix.js CHANGED
@@ -1,6 +1,10 @@
1
+ import { getGlobalBunModules } from './bunPrefix.js';
2
+ import { hasParameter } from './commandLine.js';
1
3
  import { logModuleLoaded } from './loader.js';
2
4
  logModuleLoaded('NpmPrefix');
3
5
  export async function getGlobalNodeModules() {
6
+ if (hasParameter('bun'))
7
+ return getGlobalBunModules();
4
8
  const { exec } = await import('node:child_process');
5
9
  return new Promise((resolve, reject) => {
6
10
  exec('npm root -g', (error, stdout) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@matterbridge/utils",
3
- "version": "3.9.2-dev-20260624-3362db6",
3
+ "version": "3.9.2-dev-20260625-1591faa",
4
4
  "description": "Matterbridge utils library",
5
5
  "author": "https://github.com/Luligu",
6
6
  "homepage": "https://matterbridge.io/",
@@ -50,6 +50,10 @@
50
50
  "types": "./dist/export.d.ts",
51
51
  "import": "./dist/export.js"
52
52
  },
53
+ "./bun": {
54
+ "types": "./dist/bunPrefix.d.ts",
55
+ "import": "./dist/bunPrefix.js"
56
+ },
53
57
  "./cli": {
54
58
  "types": "./dist/commandLine.d.ts",
55
59
  "import": "./dist/commandLine.js"