diff --git a/lib/internal/fs.js b/lib/internal/fs.js index 97a4c16aed19b5..e7a7299b344355 100644 --- a/lib/internal/fs.js +++ b/lib/internal/fs.js @@ -4,16 +4,17 @@ const Buffer = require('buffer').Buffer; const Writable = require('stream').Writable; const fs = require('fs'); const util = require('util'); -const constants = process.binding('constants').fs; - -const O_APPEND = constants.O_APPEND | 0; -const O_CREAT = constants.O_CREAT | 0; -const O_EXCL = constants.O_EXCL | 0; -const O_RDONLY = constants.O_RDONLY | 0; -const O_RDWR = constants.O_RDWR | 0; -const O_SYNC = constants.O_SYNC | 0; -const O_TRUNC = constants.O_TRUNC | 0; -const O_WRONLY = constants.O_WRONLY | 0; + +const { + O_APPEND, + O_CREAT, + O_EXCL, + O_RDONLY, + O_RDWR, + O_SYNC, + O_TRUNC, + O_WRONLY +} = process.binding('constants').fs; function assertEncoding(encoding) { if (encoding && !Buffer.isEncoding(encoding)) {