Skip to content

Commit

Permalink
fix: use fs.promises
Browse files Browse the repository at this point in the history
  • Loading branch information
azu committed Jul 26, 2020
1 parent dbc7ca0 commit 24d13fa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/@textlint/compiler/src/compiler.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import webpack from "webpack";
import { generateCode } from "./CodeGenerator/worker-codegen";
import { CodeGeneraterOptions } from "./CodeGenerator/CodeGeneraterOptions";
import * as fs from "fs/promises";
import * as fs from "fs";
import path from "path";
// @ts-ignore
import rimraf from "rimraf"
Expand Down Expand Up @@ -48,11 +48,11 @@ export const compile = async (options: compileOptions) => {
throw new Error(`Unknown compileTarget: ${options.compileTarget}`);
})();
const tempDir = path.join(cwd, "__textlint_compier_temp");
await fs.mkdir(tempDir, {
await fs.promises.mkdir(tempDir, {
recursive: true,
});
const inputFilePath = path.join(tempDir, "input.js");
await fs.writeFile(inputFilePath, code, "utf-8")
await fs.promises.writeFile(inputFilePath, code, "utf-8")
const outputFilePath = options.outputDir;
return new Promise((resolve, reject) => {
const config = createWebpackConfig(inputFilePath, outputFilePath);
Expand Down

0 comments on commit 24d13fa

Please sign in to comment.