Skip to content

Commit 095fc45

Browse files
author
Maël Nison
committed
Node 4 doesn't expose fs.constants
1 parent 5e1bfbb commit 095fc45

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/util/fs.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ const globModule = require('glob');
1313
const os = require('os');
1414
const path = require('path');
1515

16-
export const constants = fs.constants;
16+
export const constants = typeof fs.constants !== 'undefined' ? fs.constants : {
17+
R_OK: fs.R_OK,
18+
W_OK: fs.W_OK,
19+
X_OK: fs.X_OK,
20+
};
1721

1822
export const lockQueue = new BlockingQueue('fs lock');
1923

0 commit comments

Comments
 (0)