From bb6d0ee8b2b2047d8515825ca1a76f20d7d84f27 Mon Sep 17 00:00:00 2001 From: menshibin Date: Tue, 11 Feb 2025 14:58:09 +0800 Subject: [PATCH] docs: add node version explanation --- docs/en/14-reference/05-connector/35-node.md | 26 ++++++++++++------- docs/zh/14-reference/05-connector/35-node.mdx | 2 ++ 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/docs/en/14-reference/05-connector/35-node.md b/docs/en/14-reference/05-connector/35-node.md index 49b1d200cf..e1d06d1db6 100644 --- a/docs/en/14-reference/05-connector/35-node.md +++ b/docs/en/14-reference/05-connector/35-node.md @@ -25,6 +25,8 @@ Support all platforms that can run Node.js. | Node.js Connector Version | Major Changes | TDengine Version | | ------------------------- | ------------------------------------------------------------------------ | --------------------------- | +| 3.1.4 | Modified the readme.| - | +| 3.1.3 | Upgraded the es5-ext version to address vulnerabilities in the lower version. | - | | 3.1.2 | Optimized data protocol and parsing, significantly improved performance. | - | | 3.1.1 | Optimized data transmission performance. | 3.3.2.0 and higher versions | | 3.1.0 | New release, supports WebSocket connection. | 3.2.0.0 and higher versions | @@ -132,16 +134,20 @@ Node.js connector (`@tdengine/websocket`), which connects to a TDengine instance In addition to obtaining a connection through a specified URL, you can also use WSConfig to specify parameters when establishing a connection. ```js -try { - let url = 'ws://127.0.0.1:6041' - let conf = WsSql.NewConfig(url) - conf.setUser('root') - conf.setPwd('taosdata') - conf.setDb('db') - conf.setTimeOut(500) - let wsSql = await WsSql.open(conf); -} catch (e) { - console.error(e); +const taos = require("@tdengine/websocket"); + +async function createConnect() { + try { + let url = 'ws://127.0.0.1:6041' + let conf = WsSql.NewConfig(url) + conf.setUser('root') + conf.setPwd('taosdata') + conf.setDb('db') + conf.setTimeOut(500) + let wsSql = await taos.sqlConnect(conf) + } catch (e) { + console.error(e); + } } ``` diff --git a/docs/zh/14-reference/05-connector/35-node.mdx b/docs/zh/14-reference/05-connector/35-node.mdx index d15a7a5a63..42eff0d650 100644 --- a/docs/zh/14-reference/05-connector/35-node.mdx +++ b/docs/zh/14-reference/05-connector/35-node.mdx @@ -24,6 +24,8 @@ Node.js 连接器源码托管在 [GitHub](https://github.com/taosdata/taos-conne | Node.js 连接器 版本 | 主要变化 | TDengine 版本 | | ------------------| ----------------------| ----------------| +| 3.1.4 | 修改 readme | - | +| 3.1.3 | 升级了 es5-ext 版本,解决低版本的漏洞 | - | | 3.1.2 | 对数据协议和解析进行了优化,性能得到大幅提升| - | | 3.1.1 | 优化了数据传输性能 | 3.3.2.0 及更高版本 | | 3.1.0 | 新版本发布,支持 WebSocket 连接 | 3.2.0.0 及更高版本 |