Skip to content

Commit 7f08381

Browse files
committed
move async functions
1 parent 06cef1f commit 7f08381

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/generators.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import publicGenerators from './generators/index.mjs';
44
import astJs from './generators/ast-js/index.mjs';
55
import oramaDb from './generators/orama-db/index.mjs';
6-
import { mkdirSync, statSync } from 'node:fs';
6+
import { mkdir, stat } from 'node:fs/promises';
77

88
const availableGenerators = {
99
...publicGenerators,
@@ -53,12 +53,12 @@ const createGenerator = markdownInput => {
5353
*/
5454
const runGenerators = async ({ generators, ...extra }) => {
5555
try {
56-
if (!statSync(extra.output).isDirectory()) {
56+
if (!(await stat(extra.output).isDirectory())) {
5757
throw new Error('Output is not a directory');
5858
}
5959
} catch (err) {
6060
if (err.code === 'ENOENT') {
61-
mkdirSync(extra.output, { recursive: true });
61+
mkdir(extra.output, { recursive: true });
6262
}
6363
}
6464

0 commit comments

Comments
 (0)