bm2 1.0.34 → 1.0.36

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/src/types.ts CHANGED
@@ -124,6 +124,7 @@ export interface StartOptions {
124
124
  instances?: number;
125
125
  execMode?: ExecMode;
126
126
  autorestart?: boolean;
127
+ noDaemon?: boolean;
127
128
  maxRestarts?: number;
128
129
  minUptime?: number;
129
130
  maxMemoryRestart?: string | number;
package/src/utils.ts CHANGED
@@ -14,18 +14,18 @@
14
14
  * Author: Zak <zak@maxxpainn.com>
15
15
  */
16
16
 
17
- import { mkdirSync, existsSync } from "fs";
18
17
  import { join } from "path";
19
18
  import { ALL_DIRS, BM2_HOME } from "./constants";
19
+ import { mkdir } from "fs/promises";
20
20
 
21
21
  export const DUMP_FILE = join(BM2_HOME, "dump.json");
22
22
 
23
- export function ensureDirs() {
24
- for (const dir of ALL_DIRS) {
25
- if (!existsSync(dir)) {
26
- mkdirSync(dir, { recursive: true });
27
- }
28
- }
23
+ export async function ensureDirs() {
24
+ await Promise.all(
25
+ ALL_DIRS.map(async (dir) => {
26
+ await mkdir(dir, { recursive: true });
27
+ })
28
+ );
29
29
  }
30
30
 
31
31
  export function parseMemory(value: string | number): number {