Skip to content

Commit dc9799d

Browse files
committed
Fix Node.js 12 compatibility
Fixes #24
1 parent 657385f commit dc9799d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

index.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import {readFileSync} from 'node:fs';
2-
import {readFile} from 'node:fs/promises';
1+
import {readFileSync, promises as fs} from 'node:fs';
2+
3+
const {readFile} = fs;
34

45
const parse = (buffer, {beforeParse, reviver} = {}) => {
56
// Unlike `buffer.toString()` and `fs.readFile(path, 'utf8')`, `TextDecoder`` will remove BOM.

0 commit comments

Comments
 (0)