Skip to content

Commit

Permalink
fs: move fs.promises API to fs/promises
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
targos committed Feb 17, 2018
1 parent 2620358 commit 513d939
Show file tree
Hide file tree
Showing 8 changed files with 581 additions and 530 deletions.
6 changes: 3 additions & 3 deletions benchmark/fs/bench-stat-promise.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const common = require('../common');
const fs = require('fs');
const fsPromises = require('fs/promises');

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

async function run(n, statType) {
const arg = statType === 'fstat' ?
await fs.promises.open(__filename, 'r') : __filename;
await fsPromises.open(__filename, 'r') : __filename;
let remaining = n;
bench.start();
while (remaining-- > 0)
await fs.promises[statType](arg);
await fsPromises[statType](arg);
bench.end(n);

if (typeof arg.close === 'function')
Expand Down
Loading

0 comments on commit 513d939

Please sign in to comment.