You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by xu...@apache.org on 2025/06/12 08:08:28 UTC

(opendal) branch main updated: fix(bindings/nodejs): update nodejs and deno bench (#6286)

This is an automated email from the ASF dual-hosted git repository.

xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/opendal.git


The following commit(s) were added to refs/heads/main by this push:
     new d53fbddcf fix(bindings/nodejs): update nodejs and deno bench (#6286)
d53fbddcf is described below

commit d53fbddcff9959b8f59353f27e3a5188652fb060
Author: Kingsword <ki...@gmail.com>
AuthorDate: Thu Jun 12 16:08:21 2025 +0800

    fix(bindings/nodejs): update nodejs and deno bench (#6286)
---
 bindings/nodejs/.gitignore        | 1 +
 bindings/nodejs/benchmark/deno.ts | 6 +++---
 bindings/nodejs/benchmark/node.js | 2 +-
 bindings/nodejs/package.json      | 2 +-
 4 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/bindings/nodejs/.gitignore b/bindings/nodejs/.gitignore
index 52348a116..11191fca9 100644
--- a/bindings/nodejs/.gitignore
+++ b/bindings/nodejs/.gitignore
@@ -9,6 +9,7 @@ npm-debug.log*
 yarn-debug.log*
 yarn-error.log*
 lerna-debug.log*
+deno.lock
 
 # Diagnostic reports (https://nodejs.org/api/report.html)
 report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
diff --git a/bindings/nodejs/benchmark/deno.ts b/bindings/nodejs/benchmark/deno.ts
index 41a59397f..47229fcf4 100644
--- a/bindings/nodejs/benchmark/deno.ts
+++ b/bindings/nodejs/benchmark/deno.ts
@@ -17,9 +17,9 @@
  * under the License.
  */
 
-import { Operator } from 'npm:opendal'
-import 'https://deno.land/std@0.181.0/dotenv/load.ts'
-import { S3Client } from 'https://deno.land/x/s3_lite_client@0.5.0/mod.ts'
+import { Operator } from '../index.mjs'
+import 'jsr:@std/dotenv/load'
+import { S3Client } from 'jsr:@bradenmacdonald/s3-lite-client'
 
 const endpoint = Deno.env.get('AWS_S3_ENDPOINT') || 'http://localhost:9000'
 const url = new URL(endpoint)
diff --git a/bindings/nodejs/benchmark/node.js b/bindings/nodejs/benchmark/node.js
index ebf0e69c1..c3139b0ab 100644
--- a/bindings/nodejs/benchmark/node.js
+++ b/bindings/nodejs/benchmark/node.js
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-const { Operator } = require('../index.js')
+const { Operator } = require('../index.cjs')
 const { S3Client, PutObjectCommand, GetObjectCommand } = require('@aws-sdk/client-s3')
 const { suite, add, cycle, complete } = require('benny')
 const crypto = require('node:crypto')
diff --git a/bindings/nodejs/package.json b/bindings/nodejs/package.json
index 27a333aa8..b0d4929be 100644
--- a/bindings/nodejs/package.json
+++ b/bindings/nodejs/package.json
@@ -86,7 +86,7 @@
     "format": "prettier --write .",
     "test": "vitest",
     "bench": "node -r dotenv/config ./benchmark/node.js dotenv_config_path=./.env",
-    "bench:deno": "deno bench ./benchmark/deno.ts --reload=npm:opendal --allow-read --allow-ffi --allow-net --allow-env",
+    "bench:deno": "deno bench --unstable-detect-cjs ./benchmark/deno.ts --allow-read --allow-ffi --allow-net --allow-env",
     "prepublishOnly": "napi prepublish -t npm --skip-gh-release"
   },
   "prettier": {