fs: default open/openSync flags argument to 'r'
Make fs.open() and fs.openSync() more economic to use by making the
flags argument optional. You can now write:
fs.open(file, cb)
Instead of the more verbose:
fs.open(file, 'r', cb)
This idiom is already supported by functions like fs.readFile().
PR-URL: https://github.com/nodejs/node/pull/23767
Reviewed-By:
James M Snell <jasnell@gmail.com>
Reviewed-By:
Luigi Pinca <luigipinca@gmail.com>
Reviewed-By:
Colin Ihrig <cjihrig@gmail.com>
Reviewed-By:
Refael Ackermann <refack@gmail.com>
Reviewed-By:
Trivikram Kamat <trivikr.dev@gmail.com>
parent
62232361
Please register or sign in to comment