Skip to content

Commit 513d939

Browse files
committed
fs: move fs.promises API to fs/promises
PR-URL: #18777 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
1 parent 2620358 commit 513d939

File tree

8 files changed

+581
-530
lines changed

8 files changed

+581
-530
lines changed

benchmark/fs/bench-stat-promise.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33
const common = require('../common');
4-
const fs = require('fs');
4+
const fsPromises = require('fs/promises');
55

66
const bench = common.createBenchmark(main, {
77
n: [20e4],
@@ -10,11 +10,11 @@ const bench = common.createBenchmark(main, {
1010

1111
async function run(n, statType) {
1212
const arg = statType === 'fstat' ?
13-
await fs.promises.open(__filename, 'r') : __filename;
13+
await fsPromises.open(__filename, 'r') : __filename;
1414
let remaining = n;
1515
bench.start();
1616
while (remaining-- > 0)
17-
await fs.promises[statType](arg);
17+
await fsPromises[statType](arg);
1818
bench.end(n);
1919

2020
if (typeof arg.close === 'function')

0 commit comments

Comments
 (0)