Skip to content

Commit e64be76

Browse files
authored
Ensure Node.js 10 and 12 can use file-based detection methods (#30)
The requirement to provide `fs.close` with a callback was optional in Node.js 8, then mandatory in Node.js 10 and 12, then optional from Node.js 14 onwards. The error was caught and swallowed so users should not have noticed this.
1 parent f74b368 commit e64be76

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/filesystem.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const readFile = (path) => new Promise((resolve, reject) => {
3737
const buffer = Buffer.alloc(MAX_LENGTH);
3838
fs.read(fd, buffer, 0, MAX_LENGTH, 0, (_, bytesRead) => {
3939
resolve(buffer.subarray(0, bytesRead));
40-
fs.close(fd);
40+
fs.close(fd, () => {});
4141
});
4242
}
4343
});

0 commit comments

Comments
 (0)