Commit 3516a27
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: #23767
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Signed-off-by: Beth Griggs <[email protected]>1 parent bda45a5 commit 3516a27
File tree
4 files changed
+70
-12
lines changed- doc/api
- lib
- internal/fs
- test/parallel
4 files changed
+70
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2304 | 2304 | | |
2305 | 2305 | | |
2306 | 2306 | | |
2307 | | - | |
| 2307 | + | |
2308 | 2308 | | |
2309 | 2309 | | |
2310 | 2310 | | |
| |||
2322 | 2322 | | |
2323 | 2323 | | |
2324 | 2324 | | |
| 2325 | + | |
2325 | 2326 | | |
2326 | 2327 | | |
2327 | 2328 | | |
| |||
2343 | 2344 | | |
2344 | 2345 | | |
2345 | 2346 | | |
2346 | | - | |
| 2347 | + | |
2347 | 2348 | | |
2348 | 2349 | | |
2349 | 2350 | | |
| |||
2360 | 2361 | | |
2361 | 2362 | | |
2362 | 2363 | | |
2363 | | - | |
| 2364 | + | |
| 2365 | + | |
2364 | 2366 | | |
2365 | 2367 | | |
2366 | 2368 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
340 | 340 | | |
341 | 341 | | |
342 | 342 | | |
343 | | - | |
| 343 | + | |
344 | 344 | | |
345 | 345 | | |
346 | 346 | | |
| |||
406 | 406 | | |
407 | 407 | | |
408 | 408 | | |
409 | | - | |
410 | | - | |
411 | | - | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
412 | 412 | | |
413 | | - | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
414 | 419 | | |
415 | | - | |
416 | 420 | | |
| 421 | + | |
417 | 422 | | |
418 | 423 | | |
419 | 424 | | |
| |||
428 | 433 | | |
429 | 434 | | |
430 | 435 | | |
431 | | - | |
| 436 | + | |
432 | 437 | | |
433 | 438 | | |
434 | 439 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| 198 | + | |
| 199 | + | |
198 | 200 | | |
199 | 201 | | |
200 | 202 | | |
201 | | - | |
202 | | - | |
| 203 | + | |
203 | 204 | | |
204 | 205 | | |
205 | 206 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
39 | 45 | | |
40 | 46 | | |
41 | 47 | | |
| |||
44 | 50 | | |
45 | 51 | | |
46 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
47 | 86 | | |
48 | 87 | | |
49 | 88 | | |
| |||
59 | 98 | | |
60 | 99 | | |
61 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
62 | 112 | | |
0 commit comments