Skip to content

Commit 60b7116

Browse files
authoredJan 12, 2022
Use fs.promises.readFile instead of promisify(fs.readFile) (#204)
1 parent 79765fb commit 60b7116

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed
 

‎gitignore.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import process from 'node:process';
2-
import {promisify} from 'node:util';
32
import fs from 'node:fs';
43
import path from 'node:path';
54
import fastGlob from 'fast-glob';
@@ -13,8 +12,6 @@ const DEFAULT_IGNORE = [
1312
'**/.git',
1413
];
1514

16-
const readFileP = promisify(fs.readFile);
17-
1815
const mapGitIgnorePatternTo = base => ignore => {
1916
if (ignore.startsWith('!')) {
2017
return '!' + path.posix.join(base, ignore.slice(1));
@@ -62,7 +59,7 @@ const getIsIgnoredPredicate = (ignores, cwd) => p => ignores.ignores(slash(path.
6259

6360
const getFile = async (file, cwd) => {
6461
const filePath = path.join(cwd, file);
65-
const content = await readFileP(filePath, 'utf8');
62+
const content = await fs.promises.readFile(filePath, 'utf8');
6663

6764
return {
6865
cwd,

0 commit comments

Comments
 (0)
Please sign in to comment.