bm2 1.0.35 → 1.0.37
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/README.md +146 -13
- package/package.json +1 -1
- package/src/daemon-v1.ts +244 -0
- package/src/daemon.ts +238 -195
- package/src/index.ts +868 -817
- package/src/types.ts +1 -0
- package/src/utils.ts +7 -7
package/src/types.ts
CHANGED
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
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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 {
|