From 055cb2353104bde42ca25574adaa46edcb4771ca Mon Sep 17 00:00:00 2001 From: Brian Surowiec Date: Tue, 27 Apr 2021 23:26:26 -0400 Subject: [PATCH] Adjust how async readFile is loaded `fs/promises` isn't available in node 12 --- src/dotnet.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dotnet.ts b/src/dotnet.ts index 81acc423..29c330f7 100644 --- a/src/dotnet.ts +++ b/src/dotnet.ts @@ -1,4 +1,4 @@ -import { readFile } from "fs/promises"; +import { promises } from "fs"; import { resolve } from "path"; import { @@ -14,6 +14,8 @@ import { getPullRequestFiles } from "./files"; import type { DotNetFormatVersion } from "./version"; +const { readFile } = promises; + export type FormatFunction = (options: FormatOptions) => Promise; export interface FormatOptions {