Skip to content

Commit 91861b7

Browse files
authored
Update README.md (#86)
Here, the file needs to be read as a raw buffer, and there is no need to specify the encoding parameter.
1 parent 119b8e6 commit 91861b7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ convert its data into a base64-encoded data URI:
7474
import { promises as fs } from "fs";
7575

7676
// Read the file into a buffer
77-
const data = await fs.readFile("path/to/image.png", "utf-8");
77+
const data = await fs.readFile("path/to/image.png");
7878
// Convert the buffer into a base64-encoded string
7979
const base64 = data.toString("base64");
8080
// Set MIME type for PNG image

0 commit comments

Comments
 (0)