aboutsummaryrefslogtreecommitdiff
path: root/examples/macros/matchInFile.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'examples/macros/matchInFile.tsx')
-rw-r--r--examples/macros/matchInFile.tsx4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/macros/matchInFile.tsx b/examples/macros/matchInFile.tsx
index e434d1dec..4793661d9 100644
--- a/examples/macros/matchInFile.tsx
+++ b/examples/macros/matchInFile.tsx
@@ -1,12 +1,12 @@
// macro code
-export function matchInFile(callExpression: BunAST.CallExpression) {
+export async function matchInFile(callExpression: BunAST.CallExpression) {
const [filePathNode, matcherNode] = callExpression.arguments;
let filePath: string;
filePath = filePathNode.get();
let matcher: RegExp;
matcher = matcherNode.get();
- const file: string = Bun.readFile(Bun.cwd + filePath);
+ const file: string = await Bun.file(Bun.cwd + filePath).text();
return (
<array>