Skip to content

Commit f5b4e30

Browse files
author
Bart Veneman
committed
async readFile
1 parent 089537a commit f5b4e30

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/bin.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env node
22

3-
import { readFileSync } from 'fs'
3+
import { readFile as fsReadFile } from 'fs/promises'
44
import { join } from 'path'
55
import pc from 'picocolors'
66
import { Program } from './program'
@@ -20,9 +20,9 @@ async function getStdin() {
2020
return result
2121
}
2222

23-
function readFile(pathParam) {
23+
async function readFile(pathParam) {
2424
const pathName = join(process.cwd(), pathParam)
25-
const content = readFileSync(pathName, 'utf-8')
25+
const content = await fsReadFile(pathName, 'utf-8')
2626
return content
2727
}
2828

0 commit comments

Comments
 (0)