Skip to content

Commit

Permalink
fix: benchmark ESM build compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
kieran-ryan authored and isaacs committed May 14, 2024
1 parent 921c4b9 commit ea4734f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,14 @@ MJS

echo -n $'node current globSync mjs \t'
cat > "$wd/bench-working-dir/sync.mjs" <<MJS
import {globSync} from '$wd/dist/mjs/index.js'
import {globSync} from '$wd/dist/esm/index.js'
console.log(globSync(process.argv[2]).length)
MJS
t node "$wd/bench-working-dir/sync.mjs" "$p"

echo -n $'node current glob syncStream \t'
cat > "$wd/bench-working-dir/stream-sync.mjs" <<MJS
import {globStreamSync} from '$wd/dist/mjs/index.js'
import {globStreamSync} from '$wd/dist/esm/index.js'
let c = 0
globStreamSync(process.argv[2])
.on('data', () => c++)
Expand Down Expand Up @@ -153,14 +153,14 @@ MJS

echo -n $'node current glob async mjs \t'
cat > "$wd/bench-working-dir/async.mjs" <<MJS
import { glob } from '$wd/dist/mjs/index.js'
import { glob } from '$wd/dist/esm/index.js'
glob(process.argv[2]).then(files => console.log(files.length))
MJS
t node "$wd/bench-working-dir/async.mjs" "$p"

echo -n $'node current glob stream \t'
cat > "$wd/bench-working-dir/stream.mjs" <<MJS
import {globStream} from '$wd/dist/mjs/index.js'
import {globStream} from '$wd/dist/esm/index.js'
let c = 0
globStream(process.argv[2])
.on('data', () => c++)
Expand Down

0 comments on commit ea4734f

Please sign in to comment.