Skip to content
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.

Commit

Permalink
Use sync methods over async
Browse files Browse the repository at this point in the history
  • Loading branch information
gregives committed Dec 27, 2020
1 parent 8d16e75 commit 8db4854
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const fs = require("fs").promises;
const fs = require("fs");
const path = require("path");
const utils = require("./utils");

Expand Down Expand Up @@ -86,10 +86,10 @@ class EleventyLoad {
}

// Load content of file
async getContent(resourcePath, loaders) {
getContent(resourcePath, loaders) {
// If loader has raw property, load content as buffer instead of string
const encoding = loaders[0].loader.raw ? null : "utf8";
return await fs.readFile(resourcePath, { encoding });
return fs.readFileSync(resourcePath, { encoding });
}

// Process file with the given loaders
Expand Down

0 comments on commit 8db4854

Please sign in to comment.