Просмотр исходного кода

refactor: better API (top level await)

Brett Zamir 3 лет назад
Родитель
Сommit
46c09f741f
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      bin/optionDefinitions.js

+ 2 - 2
bin/optionDefinitions.js

@@ -1,6 +1,6 @@
-import {readFileSync} from 'fs';
+import {readFile} from 'fs/promises';
 
 
-const pkg = JSON.parse(readFileSync(
+const pkg = JSON.parse(await readFile(
   new URL('../package.json', import.meta.url)
   new URL('../package.json', import.meta.url)
 ));
 ));